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:
Kevin Ansfield 2018-05-14 15:53:34 +01:00
parent 3caa78d355
commit f791f52267
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,7 @@ export default Component.extend({
classNames: ['absolute', 'z-999'],
// public attrs
editor: null,
editorRange: null,
activeMarkupTagNames: null,
activeSectionTagNames: null,
@ -120,7 +121,11 @@ export default Component.extend({
},
toggleSection(sectionName) {
let range = this.editorRange;
this.toggleSection(sectionName);
this.editor.run((postEditor) => {
postEditor.setRange(range);
});
},
editLink() {