diff options
author | Eric Guzman | 2012-05-29 15:29:11 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-29 15:29:11 -0700 |
commit | 25ac55c285bb4850118c644dc57adaeda5b9a859 (patch) | |
tree | b645941d7916716cbaf4860355df4101fc0f4c3c /js/controllers/selection-controller.js | |
parent | 1fda3cea5f8dced1e14533969722e30b8ea1e6fa (diff) | |
parent | 58e454c828abf0b64fa62120359bcd78a0d34ac4 (diff) | |
download | ninja-25ac55c285bb4850118c644dc57adaeda5b9a859.tar.gz |
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into CSSPanelUpdates
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-x | js/controllers/selection-controller.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 1092615a..75bffc5c 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -67,10 +67,9 @@ exports.SelectionController = Montage.create(Component, { | |||
67 | this._isDocument = true; | 67 | this._isDocument = true; |
68 | 68 | ||
69 | if(currentSelectionArray) { | 69 | if(currentSelectionArray) { |
70 | if(currentSelectionArray.length >= 1) { | 70 | this.application.ninja.selectedElements = currentSelectionArray; |
71 | if(currentSelectionArray.length) { | ||
71 | this._isDocument = false; | 72 | this._isDocument = false; |
72 | |||
73 | this.application.ninja.selectedElements = currentSelectionArray; | ||
74 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); | 73 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); |
75 | } | 74 | } |
76 | } | 75 | } |
@@ -114,7 +113,7 @@ exports.SelectionController = Montage.create(Component, { | |||
114 | value: function(event) { | 113 | value: function(event) { |
115 | var selected = [], childNodes = [], self = this; | 114 | var selected = [], childNodes = [], self = this; |
116 | 115 | ||
117 | childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; | 116 | childNodes = this.application.ninja.currentDocument.model.documentRoot.childNodes; |
118 | childNodes = Array.prototype.slice.call(childNodes, 0); | 117 | childNodes = Array.prototype.slice.call(childNodes, 0); |
119 | childNodes.forEach(function(item) { | 118 | childNodes.forEach(function(item) { |
120 | if(self.isNodeTraversable(item)) { | 119 | if(self.isNodeTraversable(item)) { |
@@ -256,10 +255,10 @@ exports.SelectionController = Montage.create(Component, { | |||
256 | 255 | ||
257 | for(var i=0, uuid; this.application.ninja.selectedElements[i];i++) { | 256 | for(var i=0, uuid; this.application.ninja.selectedElements[i];i++) { |
258 | // Check for multiple selection and excluding inner elements | 257 | // Check for multiple selection and excluding inner elements |
259 | if(item.parentNode && item.parentNode !== this.application.ninja.currentDocument.documentRoot) { | 258 | if(item.parentNode && item.parentNode !== this.application.ninja.currentDocument.model.documentRoot) { |
260 | var outerElement = item.parentNode; | 259 | var outerElement = item.parentNode; |
261 | 260 | ||
262 | while(outerElement.parentNode && outerElement.parentNode !== this.application.ninja.currentDocument.documentRoot) { | 261 | while(outerElement.parentNode && outerElement.parentNode !== this.application.ninja.currentDocument.model.documentRoot) { |
263 | outerElement = outerElement.parentNode; | 262 | outerElement = outerElement.parentNode; |
264 | } | 263 | } |
265 | 264 | ||