aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/clipboard-controller.js
diff options
context:
space:
mode:
authorAnanya Sen2012-07-18 09:43:16 -0700
committerAnanya Sen2012-07-18 09:43:16 -0700
commit1cbb921537cce5d54885293e8c64833a42370154 (patch)
tree8eec86e4730386e1bd72f7625b97fe563c970550 /js/controllers/clipboard-controller.js
parent2b3a494f136f87a77b782e45733ecc86e290aba6 (diff)
downloadninja-1cbb921537cce5d54885293e8c64833a42370154.tar.gz
perform clipboard operations only if selection tool is selected since other tools have different conflicting session state
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers/clipboard-controller.js')
-rw-r--r--js/controllers/clipboard-controller.js15
1 files changed, 15 insertions, 0 deletions
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
85 return; 85 return;
86 } 86 }
87 87
88 //perform clipboard operations only if selection tool is selected
89 if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){
90 return;
91 }
92
88 if(this.clipboardContext === "stage"){ 93 if(this.clipboardContext === "stage"){
89 ElementsClipboardAgent.copy(clipboardEvent); 94 ElementsClipboardAgent.copy(clipboardEvent);
90 } 95 }
@@ -102,6 +107,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
102 return; 107 return;
103 } 108 }
104 109
110 //perform clipboard operations only if selection tool is selected
111 if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){
112 return;
113 }
114
105 if(this.clipboardContext === "stage"){ 115 if(this.clipboardContext === "stage"){
106 ElementsClipboardAgent.cut(clipboardEvent); 116 ElementsClipboardAgent.cut(clipboardEvent);
107 } 117 }
@@ -126,6 +136,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
126 return; 136 return;
127 } 137 }
128 138
139 //perform clipboard operations only if selection tool is selected
140 if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){
141 return;
142 }
143
129 //TODO: return if stage is not focussed 144 //TODO: return if stage is not focussed
130 145
131 if(this.clipboardContext === "stage"){ 146 if(this.clipboardContext === "stage"){