From 20d2722f04df62c1f5b5e0d7584999c0a608ae8a Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Fri, 14 Apr 2023 11:04:11 +0200 Subject: [PATCH] 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. --- ghost/admin/.lint-todo | 2 + .../admin/app/components/gh-context-menu.hbs | 2 +- ghost/admin/app/components/gh-context-menu.js | 42 ++++++++++++++++++- .../admin/app/styles/components/dropdowns.css | 16 ++++++- 4 files changed, 58 insertions(+), 4 deletions(-) diff --git a/ghost/admin/.lint-todo b/ghost/admin/.lint-todo index e30997a622..7a19a83d61 100644 --- a/ghost/admin/.lint-todo +++ b/ghost/admin/.lint-todo @@ -564,3 +564,5 @@ add|ember-template-lint|no-action|271|58|271|58|5124558b018d5e90a3d203fd54c5e4ca add|ember-template-lint|no-action|289|68|289|68|eaa96ff81a7c4b4743ca191655c017bd90549e96|1680566400000|1690934400000|1696118400000|app/components/modal-portal-settings.hbs add|ember-template-lint|no-invalid-interactive|1|103|1|103|f5a46b2538fbf79a40f2683ff1151ca60e0fa0ca|1680652800000|1691020800000|1696204800000|app/components/gh-context-menu.hbs add|ember-template-lint|no-invalid-interactive|5|53|5|53|9647ef6afba919b2af04fe551b0fdf0fb63be849|1680652800000|1691020800000|1696204800000|app/components/gh-context-menu.hbs +remove|ember-template-lint|no-invalid-interactive|1|103|1|103|f5a46b2538fbf79a40f2683ff1151ca60e0fa0ca|1680652800000|1691020800000|1696204800000|app/components/gh-context-menu.hbs +add|ember-template-lint|no-invalid-interactive|1|103|1|103|534029ab0ba1b74eff4a2f31c8b4dd9f1460316a|1681430400000|1691798400000|1696982400000|app/components/gh-context-menu.hbs diff --git a/ghost/admin/app/components/gh-context-menu.hbs b/ghost/admin/app/components/gh-context-menu.hbs index cc3ce661fb..c05a224ab3 100644 --- a/ghost/admin/app/components/gh-context-menu.hbs +++ b/ghost/admin/app/components/gh-context-menu.hbs @@ -1,5 +1,5 @@