diff options
Diffstat (limited to 'js/mediators')
-rwxr-xr-x | js/mediators/element-mediator.js | 6 | ||||
-rwxr-xr-x | js/mediators/keyboard-mediator.js | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 95aec2a3..6088aeab 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -101,7 +101,10 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
101 | { | 101 | { |
102 | el.elementModel.controller["set3DProperties"](el, [p3d], 0, true); | 102 | el.elementModel.controller["set3DProperties"](el, [p3d], 0, true); |
103 | } | 103 | } |
104 | if(!noEvent) NJevent("elementAdded", el); | 104 | if(!noEvent) { |
105 | this.application.ninja.documentController.activeDocument.markEdited(); | ||
106 | NJevent("elementAdded", el); | ||
107 | } | ||
105 | } | 108 | } |
106 | }, | 109 | }, |
107 | 110 | ||
@@ -127,6 +130,7 @@ exports.ElementMediator = Montage.create(NJComponent, { | |||
127 | _removeElement: { | 130 | _removeElement: { |
128 | value: function(el, rules) { | 131 | value: function(el, rules) { |
129 | ElementController.removeElement(el, rules); | 132 | ElementController.removeElement(el, rules); |
133 | this.application.ninja.documentController.activeDocument.markEdited(); | ||
130 | NJevent("elementDeleted", el); | 134 | NJevent("elementDeleted", el); |
131 | } | 135 | } |
132 | }, | 136 | }, |
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"); |