diff options
author | Valerio Virgillito | 2012-07-20 13:36:53 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-20 13:36:53 -0700 |
commit | 06c3fef350863b0c467c6fb7b0bd01f70f81a029 (patch) | |
tree | 03d8d2e90b776d086c924f95d2ebfef9eb4dd0cb /js/controllers | |
parent | 05028b38f3e6aeadd10c4a9cbb3a609af516da02 (diff) | |
parent | bf4bd611e6fadf45fa9dc50ad72902040075ff0c (diff) | |
download | ninja-06c3fef350863b0c467c6fb7b0bd01f70f81a029.tar.gz |
Merge branch 'copy-paste-bugfix' of https://github.com/ananyasen/ninja into v0.7.1
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/clipboard-controller.js | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js index c3543c95..3eba1bec 100644 --- a/js/controllers/clipboard-controller.js +++ b/js/controllers/clipboard-controller.js | |||
@@ -82,16 +82,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component | |||
82 | 82 | ||
83 | // Don't do anything if an input or other control is focused except the copy menu button | 83 | // Don't do anything if an input or other control is focused except the copy menu button |
84 | if(document.activeElement.nodeName !== "BODY") { | 84 | if(document.activeElement.nodeName !== "BODY") { |
85 | if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { | 85 | if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) { |
86 | return; | 86 | return; |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | //perform clipboard operations only if selection tool is selected | ||
91 | if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ | ||
92 | return; | ||
93 | } | ||
94 | |||
95 | if(this.clipboardContext === "stage"){ | 90 | if(this.clipboardContext === "stage"){ |
96 | ElementsClipboardAgent.copy(clipboardEvent); | 91 | ElementsClipboardAgent.copy(clipboardEvent); |
97 | } | 92 | } |
@@ -106,16 +101,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component | |||
106 | 101 | ||
107 | // Don't do anything if an input or other control is focused | 102 | // Don't do anything if an input or other control is focused |
108 | if(document.activeElement.nodeName !== "BODY") { | 103 | if(document.activeElement.nodeName !== "BODY") { |
109 | if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { | 104 | if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) { |
110 | return; | 105 | return; |
111 | } | 106 | } |
112 | } | 107 | } |
113 | 108 | ||
114 | //perform clipboard operations only if selection tool is selected | ||
115 | if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ | ||
116 | return; | ||
117 | } | ||
118 | |||
119 | if(this.clipboardContext === "stage"){ | 109 | if(this.clipboardContext === "stage"){ |
120 | ElementsClipboardAgent.cut(clipboardEvent); | 110 | ElementsClipboardAgent.cut(clipboardEvent); |
121 | } | 111 | } |
@@ -137,16 +127,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component | |||
137 | 127 | ||
138 | // Don't do anything if an input or other control is focused | 128 | // Don't do anything if an input or other control is focused |
139 | if(document.activeElement.nodeName !== "BODY") { | 129 | if(document.activeElement.nodeName !== "BODY") { |
140 | if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { | 130 | if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) { |
141 | return; | 131 | return; |
142 | } | 132 | } |
143 | } | 133 | } |
144 | 134 | ||
145 | //perform clipboard operations only if selection tool is selected | ||
146 | if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){ | ||
147 | return; | ||
148 | } | ||
149 | |||
150 | //TODO: return if stage is not focussed | 135 | //TODO: return if stage is not focussed |
151 | 136 | ||
152 | if(this.clipboardContext === "stage"){ | 137 | if(this.clipboardContext === "stage"){ |