diff options
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/clipboard-controller.js | 15 |
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++; |