Koenig - Fixed text deselection when toggling section formatting via toolbar
refs https://github.com/TryGhost/Ghost/issues/9623 - maintains easy reversibility by keeping text selected and toolbar shown in the same position to avoid jumping buttons when font size or other formatting changes
This commit is contained in:
parent
3caa78d355
commit
f791f52267
|
@ -26,6 +26,7 @@ export default Component.extend({
|
||||||
classNames: ['absolute', 'z-999'],
|
classNames: ['absolute', 'z-999'],
|
||||||
|
|
||||||
// public attrs
|
// public attrs
|
||||||
|
editor: null,
|
||||||
editorRange: null,
|
editorRange: null,
|
||||||
activeMarkupTagNames: null,
|
activeMarkupTagNames: null,
|
||||||
activeSectionTagNames: null,
|
activeSectionTagNames: null,
|
||||||
|
@ -120,7 +121,11 @@ export default Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleSection(sectionName) {
|
toggleSection(sectionName) {
|
||||||
|
let range = this.editorRange;
|
||||||
this.toggleSection(sectionName);
|
this.toggleSection(sectionName);
|
||||||
|
this.editor.run((postEditor) => {
|
||||||
|
postEditor.setRange(range);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
editLink() {
|
editLink() {
|
||||||
|
|
Loading…
Reference in New Issue