Ghost/ghost/admin/app/components/gh-context-menu.hbs
Simon Backx 20d2722f04 Updated context menu to swap position if outside window
refs https://github.com/TryGhost/Team/issues/2677

When opening a context menu close to the border of the window, the menu went outside the window. This PR updates the position mirror horizontally or vertically if the menu would go outside the window.
2023-04-14 11:04:11 +02:00

7 lines
398 B
Handlebars

<div role="menu" class="gh-context-menu-container" {{did-insert this.setup}} data-open={{this.isOpen}} {{on "click" this.stopClicks}}>
<div class="gh-context-menu {{this.class}}" style={{this.style}}>
{{yield this this.selectionList}}
</div>
<div role="none" class="gh-context-menu-overlay" {{on "click" this.close}} {{on "contextmenu" this.onContextMenuOutside}}></div>
</div>