aboutsummaryrefslogtreecommitdiff
path: root/js/mediators/keyboard-mediator.js
diff options
context:
space:
mode:
authorJose Antonio Marquez Russo2012-02-18 19:40:43 -0800
committerJose Antonio Marquez Russo2012-02-18 19:40:43 -0800
commitc466bcf61351b50f678100ca14096f71a0a71bd0 (patch)
tree4ac283e0e7724e5ede21c1a1e97d121033578c72 /js/mediators/keyboard-mediator.js
parente23708721a71ca4c71365f5f8e8ac7d6113926db (diff)
parent8fdce771bfcf662cf1acc16d45e4361ffd06c53e (diff)
downloadninja-c466bcf61351b50f678100ca14096f71a0a71bd0.tar.gz
Merge pull request #10 from ananyasen/FileIO
FileIO branch pull request
Diffstat (limited to 'js/mediators/keyboard-mediator.js')
-rwxr-xr-xjs/mediators/keyboard-mediator.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index e8a11ad8..40b26582 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -85,7 +85,8 @@ exports.KeyboardMediator = Montage.create(Component, {
85 85
86 handleKeydown: { 86 handleKeydown: {
87 value: function(evt) { 87 value: function(evt) {
88 if(document.activeElement.nodeName !== "BODY") { 88 if((document.activeElement.nodeName !== "BODY") && (!!this.application.ninja.documentController.activeDocument)
89 && (this.application.ninja.documentController.activeDocument.currentView === "design")) {
89 // Don't do anything if an input or other control is focused 90 // Don't do anything if an input or other control is focused
90 return; 91 return;
91 } 92 }
@@ -110,6 +111,13 @@ exports.KeyboardMediator = Montage.create(Component, {
110 return; 111 return;
111 } 112 }
112 113
114 // Check if cmd+s/ctrl+s for Save (Windows/Mac)
115 if ((evt.keyCode == Keyboard.S) && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey) {
116 NJevent("executeSave");
117 evt.preventDefault();
118 return;
119 }
120
113 // Check if cmd+shift+z for Redo (Mac) 121 // Check if cmd+shift+z for Redo (Mac)
114 if ((evt.keyCode == Keyboard.Z) && evt.metaKey && evt.shiftKey) { 122 if ((evt.keyCode == Keyboard.Z) && evt.metaKey && evt.shiftKey) {
115 NJevent("executeRedo"); 123 NJevent("executeRedo");