diff options
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-x | js/controllers/selection-controller.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 5665b09c..a81cdf7f 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -112,12 +112,12 @@ exports.SelectionController = Montage.create(Component, { | |||
112 | 112 | ||
113 | handleSelectAll: { | 113 | handleSelectAll: { |
114 | value: function(event) { | 114 | value: function(event) { |
115 | var selected = [], childNodes = []; | 115 | var selected = [], childNodes = [], self = this; |
116 | 116 | ||
117 | childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; | 117 | childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; |
118 | childNodes = Array.prototype.slice.call(childNodes, 0); | 118 | childNodes = Array.prototype.slice.call(childNodes, 0); |
119 | childNodes.forEach(function(item) { | 119 | childNodes.forEach(function(item) { |
120 | if(item.nodeType == 1) { | 120 | if(self.isNodeTraversable(item)) { |
121 | selected.push(item); | 121 | selected.push(item); |
122 | } | 122 | } |
123 | }); | 123 | }); |
@@ -152,7 +152,6 @@ exports.SelectionController = Montage.create(Component, { | |||
152 | 152 | ||
153 | selectElement: { | 153 | selectElement: { |
154 | value: function(element) { | 154 | value: function(element) { |
155 | |||
156 | if(this.findSelectedElement(element) === -1) { | 155 | if(this.findSelectedElement(element) === -1) { |
157 | 156 | ||
158 | if(this.application.ninja.currentDocument.inExclusion(element) !== -1){ | 157 | if(this.application.ninja.currentDocument.inExclusion(element) !== -1){ |
@@ -281,6 +280,13 @@ exports.SelectionController = Montage.create(Component, { | |||
281 | 280 | ||
282 | return -1; | 281 | return -1; |
283 | } | 282 | } |
283 | }, | ||
284 | |||
285 | isNodeTraversable: { | ||
286 | value: function( item ) { | ||
287 | if(item.nodeType !== 1) return false; | ||
288 | return ((item.nodeName !== "STYLE") && (item.nodeName !== "SCRIPT")); | ||
289 | } | ||
284 | } | 290 | } |
285 | 291 | ||
286 | }); | 292 | }); |