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(+) 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