mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
🐛 fix broken editor at mobile sizes (#790)
closes https://github.com/TryGhost/Ghost/issues/8657 - add checks for the toolbar being present before attempting to set classes on the buttons
This commit is contained in:
parent
84b2824f95
commit
09bc15e980
@ -231,16 +231,20 @@ export default Component.extend(ShortcutsMixin, {
|
||||
let sideBySideButton = this._editor.toolbarElements['side-by-side'];
|
||||
let spellcheckButton = this._editor.toolbarElements.spellcheck;
|
||||
|
||||
if (this.get('_isSplitScreen')) {
|
||||
sideBySideButton.classList.add('active');
|
||||
} else {
|
||||
sideBySideButton.classList.remove('active');
|
||||
if (sideBySideButton) {
|
||||
if (this.get('_isSplitScreen')) {
|
||||
sideBySideButton.classList.add('active');
|
||||
} else {
|
||||
sideBySideButton.classList.remove('active');
|
||||
}
|
||||
}
|
||||
|
||||
if (this._editor.codemirror.getOption('mode') === 'spell-checker') {
|
||||
spellcheckButton.classList.add('active');
|
||||
} else {
|
||||
spellcheckButton.classList.remove('active');
|
||||
if (spellcheckButton) {
|
||||
if (this._editor.codemirror.getOption('mode') === 'spell-checker') {
|
||||
spellcheckButton.classList.add('active');
|
||||
} else {
|
||||
spellcheckButton.classList.remove('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -437,10 +441,16 @@ export default Component.extend(ShortcutsMixin, {
|
||||
preview.action(this._editor);
|
||||
}
|
||||
|
||||
previewButton.classList.add('disabled');
|
||||
if (previewButton) {
|
||||
previewButton.classList.add('disabled');
|
||||
}
|
||||
|
||||
run.scheduleOnce('afterRender', this, this._connectSplitPreview);
|
||||
} else {
|
||||
previewButton.classList.remove('disabled');
|
||||
if (previewButton) {
|
||||
previewButton.classList.remove('disabled');
|
||||
}
|
||||
|
||||
run.scheduleOnce('afterRender', this, this._disconnectSplitPreview);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user