aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/selection-controller.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-07 10:38:04 -0700
committerJose Antonio Marquez2012-05-07 10:38:04 -0700
commit5293ede5f3493900df93da33197416d853f8d907 (patch)
tree3155deaea5616fa09fc96c84567419fec5f288a2 /js/controllers/selection-controller.js
parent9c0bda09a502472768f6dd5090a882d11be58d23 (diff)
parent30e837ade2da7cb20caf7c5a69faf0888736bb9a (diff)
downloadninja-5293ede5f3493900df93da33197416d853f8d907.tar.gz
Merge branch 'refs/heads/Ninja-DOM-Architecture' into Document
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-xjs/controllers/selection-controller.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 2bd774f5..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 });
@@ -280,6 +280,13 @@ exports.SelectionController = Montage.create(Component, {
280 280
281 return -1; 281 return -1;
282 } 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 }
283 } 290 }
284 291
285}); 292});