From ec65fc890b1040509401d70379d99845ae9877a7 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 25 Apr 2018 15:11:45 +0100 Subject: [PATCH] Koenig - Fixed card context menus sometimes being misplaced refs https://github.com/TryGhost/Ghost/issues/9505 - sometimes the toolbar was not in a state to measure correctly during `didInsertElement` so the positioning was incorrect - fixed by re-calculating width/height each time we want to show the toolbar --- ghost/admin/lib/koenig-editor/addon/components/koenig-card.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-card.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-card.js index fe7654e267..148d4d06cb 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-card.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-card.js @@ -172,6 +172,8 @@ export default Component.extend({ _showToolbar() { // only show a toolbar if we have one if (this.get('toolbar')) { + this._setToolbarProperties(); + if (!this.get('showToolbar') && !this._onMousemoveHandler) { this._onMousemoveHandler = run.bind(this, this._handleMousemove); window.addEventListener('mousemove', this._onMousemoveHandler);