From 1cbb921537cce5d54885293e8c64833a42370154 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 18 Jul 2012 09:43:16 -0700 Subject: perform clipboard operations only if selection tool is selected since other tools have different conflicting session state Signed-off-by: Ananya Sen --- js/controllers/clipboard-controller.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/controllers/clipboard-controller.js') diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js index d2173e31..50538477 100644 --- a/js/controllers/clipboard-controller.js +++ b/js/controllers/clipboard-controller.js @@ -85,6 +85,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component return; } + //perform clipboard operations only if selection tool is selected + if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ + return; + } + if(this.clipboardContext === "stage"){ ElementsClipboardAgent.copy(clipboardEvent); } @@ -102,6 +107,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component return; } + //perform clipboard operations only if selection tool is selected + if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ + return; + } + if(this.clipboardContext === "stage"){ ElementsClipboardAgent.cut(clipboardEvent); } @@ -126,6 +136,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component return; } + //perform clipboard operations only if selection tool is selected + if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ + return; + } + //TODO: return if stage is not focussed if(this.clipboardContext === "stage"){ -- cgit v1.2.3 From 819348eaf3ff6b4a8c38ecca7c18f6dacac7f03b Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 18 Jul 2012 15:08:37 -0700 Subject: Fixed some issues with the menu-fixes - Fixed the dark background on file open - Fixed the copy/paste/cut menu not working. Signed-off-by: Valerio Virgillito --- js/controllers/clipboard-controller.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'js/controllers/clipboard-controller.js') diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js index d2173e31..afc94c8c 100644 --- a/js/controllers/clipboard-controller.js +++ b/js/controllers/clipboard-controller.js @@ -80,9 +80,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component return; }//for design view only - // Don't do anything if an input or other control is focused + // Don't do anything if an input or other control is focused except the copy menu button if(document.activeElement.nodeName !== "BODY") { - return; + if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { + return; + } } if(this.clipboardContext === "stage"){ @@ -99,7 +101,9 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { - return; + if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { + return; + } } if(this.clipboardContext === "stage"){ @@ -123,7 +127,9 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { - return; + if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { + return; + } } //TODO: return if stage is not focussed -- cgit v1.2.3 From 0b6e845b4afe8cf3571351bd7b2aa872fab61c71 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 19 Jul 2012 17:08:08 -0700 Subject: copy/paste from external apps - removed unnecessary selection change to fix PI redraw issue Signed-off-by: Ananya Sen Conflicts: js/controllers/clipboard-controller.js Signed-off-by: Ananya Sen --- js/controllers/clipboard-controller.js | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'js/controllers/clipboard-controller.js') diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js index c3543c95..afc94c8c 100644 --- a/js/controllers/clipboard-controller.js +++ b/js/controllers/clipboard-controller.js @@ -87,11 +87,6 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component } } - //perform clipboard operations only if selection tool is selected - if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ - return; - } - if(this.clipboardContext === "stage"){ ElementsClipboardAgent.copy(clipboardEvent); } @@ -111,11 +106,6 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component } } - //perform clipboard operations only if selection tool is selected - if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ - return; - } - if(this.clipboardContext === "stage"){ ElementsClipboardAgent.cut(clipboardEvent); } @@ -142,11 +132,6 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component } } - //perform clipboard operations only if selection tool is selected - if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ - return; - } - //TODO: return if stage is not focussed if(this.clipboardContext === "stage"){ -- cgit v1.2.3 From 0d414eaeae13bb520e52ddace0a83c03eb9e7769 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 20 Jul 2012 12:18:49 -0700 Subject: fixing logical error which was a side-effect of SHA:819348eaf3ff6b4a8c38ecca7c18f6dacac7f03b recently Signed-off-by: Ananya Sen --- js/controllers/clipboard-controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/controllers/clipboard-controller.js') diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js index afc94c8c..3eba1bec 100644 --- a/js/controllers/clipboard-controller.js +++ b/js/controllers/clipboard-controller.js @@ -82,7 +82,7 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component // Don't do anything if an input or other control is focused except the copy menu button if(document.activeElement.nodeName !== "BODY") { - if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { + if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) { return; } } @@ -101,7 +101,7 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { - if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { + if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) { return; } } @@ -127,7 +127,7 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { - if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { + if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) { return; } } -- cgit v1.2.3