Merge pull request #4375 from DaveRobson/#4253

Editor must be focused before allowing certain keyboard shortcuts.
This commit is contained in:
Matt Enlow 2014-11-03 10:30:30 -07:00
commit 8d96cb2f67

View File

@ -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);
}
}
},