Created
March 5, 2019 09:47
-
-
Save jpzwarte/5b6f848a8cbc1488779181894382f306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sets the appropriate positions on a position strategy | |
* so the overlay connects with the trigger correctly. | |
* @param positionStrategy Strategy whose position to update. | |
*/ | |
private setPosition(positionStrategy: FlexibleConnectedPositionStrategy) { | |
let positions: ConnectedPosition[]; | |
if (this.triggersSubmenu()) { | |
// When the menu is a sub-menu, it should always align itself | |
// to the edges of the trigger, instead of overlapping it. | |
positions = convertMenuPositionToConnectedPositions(['right', 'top'], -MENU_PANEL_TOP_PADDING); | |
} else { | |
positions = convertMenuPositionToConnectedPositions(this.menu.position); | |
} | |
positionStrategy.withPositions(positions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what is this.menuOpened?