mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
🐛 Koenig - Fixed required double-click on (+) when cursor is not in same paragraph
refs https://github.com/TryGhost/Ghost/issues/9724 - ignore the range change which would otherwise close the menu when clicking a (+) next to a different paragraph then the one the cursor is currently on
This commit is contained in:
parent
e659dcdec7
commit
235d71d6a0
@ -66,11 +66,12 @@ export default Component.extend({
|
||||
}
|
||||
|
||||
// hide the menu if the editor range has changed
|
||||
if (this.showMenu && editorRange && !editorRange.isBlank && !editorRange.isEqual(this._lastEditorRange)) {
|
||||
if (!this._ignoreRangeChange && this.showMenu && editorRange && !editorRange.isBlank && !editorRange.isEqual(this._lastEditorRange)) {
|
||||
this._hideMenu();
|
||||
}
|
||||
|
||||
this._lastEditorRange = editorRange;
|
||||
this._ignoreRangeChange = false;
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
@ -273,6 +274,7 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
_moveCaretToCachedEditorRange() {
|
||||
this._ignoreRangeChange = true;
|
||||
this.set('editorRange', this._editorRange);
|
||||
this.editor.selectRange(this._editorRange);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{#if showButton}}
|
||||
<button class="koenig-plus-menu-button flex justify-center items-center relative w9 h9 ba b--midlightgrey-l2 bg-white br-100 anim-normal" {{action "openMenu"}}>{{svg-jar "plus" class="w4 h4 stroke-middarkgrey i-strokew--2"}}</button>
|
||||
<button class="koenig-plus-menu-button flex justify-center items-center relative w9 h9 ba b--midlightgrey-l2 bg-white br-100 anim-normal" onclick={{action "openMenu"}}>{{svg-jar "plus" class="w4 h4 stroke-middarkgrey i-strokew--2"}}</button>
|
||||
{{/if}}
|
||||
|
||||
{{#if showMenu}}
|
||||
|
Loading…
Reference in New Issue
Block a user