From ff1d16858ebb7ec4c95bd05471b768eb2c1a9d2a Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 15 Mar 2018 17:25:10 +0000 Subject: [PATCH] Koenig - Standardise on but allow to be toggled off via toolbar refs https://github.com/TryGhost/Ghost/issues/9505 - switch toolbar `I` button to toggle `` instead of ``, this standardises it with the Meta+I shortcut - if the active markup is `` instead of `` then highlight the `I` button and allow it to be toggled off to prevent confusion --- lib/koenig-editor/addon/components/koenig-toolbar.js | 4 ++++ .../addon/templates/components/koenig-toolbar.hbs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/koenig-editor/addon/components/koenig-toolbar.js b/lib/koenig-editor/addon/components/koenig-toolbar.js index dbb80b8438..57335ea053 100644 --- a/lib/koenig-editor/addon/components/koenig-toolbar.js +++ b/lib/koenig-editor/addon/components/koenig-toolbar.js @@ -98,6 +98,10 @@ export default Component.extend({ actions: { toggleMarkup(markupName) { + if (markupName === 'em' && this.get('activeMarkupTagNames.isI')) { + markupName = 'i'; + } + this.toggleMarkup(markupName); }, diff --git a/lib/koenig-editor/addon/templates/components/koenig-toolbar.hbs b/lib/koenig-editor/addon/templates/components/koenig-toolbar.hbs index 67e100075e..7e1500d702 100644 --- a/lib/koenig-editor/addon/templates/components/koenig-toolbar.hbs +++ b/lib/koenig-editor/addon/templates/components/koenig-toolbar.hbs @@ -10,8 +10,8 @@