From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:07:23 -0700 Subject: Cleaning up referencing to 'documentRoot' and '_document' Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view. --- js/controllers/selection-controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/controllers/selection-controller.js') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 1092615a..7bef0db8 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -114,7 +114,7 @@ exports.SelectionController = Montage.create(Component, { value: function(event) { var selected = [], childNodes = [], self = this; - childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; + childNodes = this.application.ninja.currentDocument.model.documentRoot.childNodes; childNodes = Array.prototype.slice.call(childNodes, 0); childNodes.forEach(function(item) { if(self.isNodeTraversable(item)) { @@ -256,10 +256,10 @@ exports.SelectionController = Montage.create(Component, { for(var i=0, uuid; this.application.ninja.selectedElements[i];i++) { // Check for multiple selection and excluding inner elements - if(item.parentNode && item.parentNode !== this.application.ninja.currentDocument.documentRoot) { + if(item.parentNode && item.parentNode !== this.application.ninja.currentDocument.model.documentRoot) { var outerElement = item.parentNode; - while(outerElement.parentNode && outerElement.parentNode !== this.application.ninja.currentDocument.documentRoot) { + while(outerElement.parentNode && outerElement.parentNode !== this.application.ninja.currentDocument.model.documentRoot) { outerElement = outerElement.parentNode; } -- cgit v1.2.3 From 209ec9524a987a8f8bc20c57e2a76ac55be15fd9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 24 May 2012 11:11:47 -0700 Subject: Fixed selection bug when switching/opening documents. Also, use saved scroll values when switching between documents. Signed-off-by: Nivesh Rajbhandari --- js/controllers/selection-controller.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'js/controllers/selection-controller.js') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 1092615a..214b9032 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -67,10 +67,9 @@ exports.SelectionController = Montage.create(Component, { this._isDocument = true; if(currentSelectionArray) { - if(currentSelectionArray.length >= 1) { + this.application.ninja.selectedElements = currentSelectionArray; + if(currentSelectionArray.length) { this._isDocument = false; - - this.application.ninja.selectedElements = currentSelectionArray; NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); } } -- cgit v1.2.3