From 1b2af54128985c1b622e13ea740a8402e57527cc Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 17:11:02 -0700 Subject: Temporarily skipping activeDocument.currentView check so keyboard shortcuts still work. Signed-off-by: Nivesh Rajbhandari --- js/mediators/keyboard-mediator.js | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index f8934669..49960f58 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -87,7 +87,8 @@ exports.KeyboardMediator = Montage.create(Component, { value: function(evt) { //keyboard controls for html design view - if((!!this.application.ninja.documentController.activeDocument) && (this.application.ninja.documentController.activeDocument.currentView === "design")){ + // TODO - New template mode doesn't set currentView yet. + if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { @@ -256,7 +257,7 @@ exports.KeyboardMediator = Montage.create(Component, { handleKeyup: { value: function(evt) { //keyboard controls for html design view - if((!!this.application.ninja.documentController.activeDocument) && (this.application.ninja.documentController.activeDocument.currentView === "design")){ + if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ if(document.activeElement.nodeName !== "BODY") { // Don't do anything if an input or other control is focused return; @@ -265,31 +266,5 @@ exports.KeyboardMediator = Montage.create(Component, { if(this.application.ninja.toolsData) this.application.ninja.toolsData.selectedToolInstance.HandleKeyUp(evt); } } - }, - - _handleKeydown: { - value: function(evt) { - - // Check if cmd-shift-+/ctrl-shift-+ for toggling snapping - if(evt.shiftKey && (evt.ctrlKey || evt.metaKey) && (evt.keyCode === 187)) - { - MainMenuModule.MenuActionManager.toggleSnapping("snap", !DocumentManagerModule.DocumentManager.activeDocument.snapping); - evt.preventDefault(); - return; - } - - if(evt.keyCode === Keyboard.PLUS && (evt.metaKey||evt.ctrlKey)) { - evt.preventDefault(); - this._toolsList.action("zoomIn", evt); - return; - } - - if(evt.keyCode === Keyboard.MINUS && (evt.metaKey || evt.ctrlKey)) { - evt.preventDefault(); - this._toolsList.action("zoomOut", evt); - return; - } - - } } }); -- cgit v1.2.3 From fd54dabad7cbc27a0efb0957155c00d578912909 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:32:36 -0700 Subject: changing @change to propertyChangeListener Signed-off-by: Valerio Virgillito --- js/mediators/keyboard-mediator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 49960f58..243caf5c 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -67,7 +67,7 @@ exports.KeyboardMediator = Montage.create(Component, { document.addEventListener("keydown", this, false); document.addEventListener("keyup", this, false); - this.addEventListener("change@appModel.livePreview", this.handleLivePreview, false); + this.addPropertyChangeListener("appModel.livePreview", this.handleLivePreview, false); } }, -- cgit v1.2.3 From ee54342b5f4fdd41c46543d6402e649e4b3d57cb Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 22 May 2012 17:58:23 -0700 Subject: - don't redraw stage for code document - fixes a switching bug - fix for ctrl+S for code document - disallow opening the panels while in code document Signed-off-by: Ananya Sen --- js/mediators/keyboard-mediator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 23a2ce75..2f55edb4 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -88,7 +88,7 @@ exports.KeyboardMediator = Montage.create(Component, { //keyboard controls for html design view // TODO - New template mode doesn't set currentView yet. - if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ + if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.model.currentView === "design")){ // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { -- cgit v1.2.3 From bf8a79b0ed1593b5b9e3085373dcdab9aeab055e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 24 May 2012 10:46:28 -0700 Subject: Keyboard arrows were not working because some code had not been updated to check updated document model. Signed-off-by: Nivesh Rajbhandari --- js/mediators/keyboard-mediator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 2f55edb4..e2e8e937 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -88,7 +88,7 @@ exports.KeyboardMediator = Montage.create(Component, { //keyboard controls for html design view // TODO - New template mode doesn't set currentView yet. - if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.model.currentView === "design")){ + if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.currentView === "design")) { // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { @@ -252,7 +252,7 @@ exports.KeyboardMediator = Montage.create(Component, { handleKeyup: { value: function(evt) { //keyboard controls for html design view - if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ + if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.currentView === "design")) { if(document.activeElement.nodeName !== "BODY") { // Don't do anything if an input or other control is focused return; -- cgit v1.2.3