aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnanya Sen2012-06-15 17:07:58 -0700
committerAnanya Sen2012-06-15 17:07:58 -0700
commit6aca635e82d7f5c1e3f6a4964d041c1d8eb3f306 (patch)
treee495d4d66902a996b47681d59556bda511d1a5c0
parentd7123dd2f0ec035648ecf7bdec0cb66bdea72e04 (diff)
downloadninja-6aca635e82d7f5c1e3f6a4964d041c1d8eb3f306.tar.gz
Fixed - IKNINJA-1748 - While pasting text in any text field in the PI, the text gets pasted on the stage
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
-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 c8520e04..db581d37 100644
--- a/js/controllers/clipboard-controller.js
+++ b/js/controllers/clipboard-controller.js
@@ -82,6 +82,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
82 return; 82 return;
83 }//for design view only 83 }//for design view only
84 84
85 // Don't do anything if an input or other control is focused
86 if(document.activeElement.nodeName !== "BODY") {
87 return;
88 }
89
85 this.copy(clipboardEvent); 90 this.copy(clipboardEvent);
86 91
87 clipboardEvent.preventDefault(); 92 clipboardEvent.preventDefault();
@@ -92,6 +97,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
92 value:function(clipboardEvent){ 97 value:function(clipboardEvent){
93 if(this.application.ninja.currentDocument.currentView === "code") return; 98 if(this.application.ninja.currentDocument.currentView === "code") return;
94 99
100 // Don't do anything if an input or other control is focused
101 if(document.activeElement.nodeName !== "BODY") {
102 return;
103 }
104
95 this.cut(clipboardEvent); 105 this.cut(clipboardEvent);
96 106
97 clipboardEvent.preventDefault(); 107 clipboardEvent.preventDefault();
@@ -113,6 +123,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
113 return; 123 return;
114 }//for design view only 124 }//for design view only
115 125
126 // Don't do anything if an input or other control is focused
127 if(document.activeElement.nodeName !== "BODY") {
128 return;
129 }
130
116 //TODO: return if stage is not focussed 131 //TODO: return if stage is not focussed
117 132
118 this.pasteCounter++; 133 this.pasteCounter++;