mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 11:30:55 +03:00
Merge pull request #4375 from DaveRobson/#4253
Editor must be focused before allowing certain keyboard shortcuts.
This commit is contained in:
commit
8d96cb2f67
@ -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 New Issue
Block a user