mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Editor must be focused before allowing certain keyboard shortcuts.
closes #4253 - checked for the CodeMirror-focused class on the CodeMirror div - used length to determine whether CodeMirror-focused has been added - determines whether the editor has been focused on
This commit is contained in:
parent
bc3c01d36b
commit
8bcfd16f19
1 changed files with 4 additions and 1 deletions
|
@ -22,7 +22,10 @@ var EditorRouteBase = Ember.Mixin.create(styleBody, ShortcutsRoute, loadingIndic
|
|||
|
||||
// The actual functionality is implemented in utils/codemirror-shortcuts
|
||||
codeMirrorShortcut: function (options) {
|
||||
this.get('controller.codemirror').shortcut(options.type);
|
||||
// Only fire editor shortcuts when the editor has focus.
|
||||
if (Ember.$('.CodeMirror.CodeMirror-focused').length > 0) {
|
||||
this.get('controller.codemirror').shortcut(options.type);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue