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 e9ead57da5
commit d760e5633c

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() {