From 52ca1c95d6f000503f44fa5f3139557e770a7773 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 15:12:52 -0700 Subject: hack fix for the PI section throwing errors when dom is not ready to draw Signed-off-by: Valerio Virgillito --- js/controllers/selection-controller.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 9ae1cfc9..6d982e69 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -34,6 +34,7 @@ exports.SelectionController = Montage.create(Component, { } if(this._currentDocument && this._currentDocument.currentView === "design") { + this.ignoreFlag = false; this._currentDocument.model._selection = this.application.ninja.selectedElements; // this._currentDocument.model.selectionContainer = this.application.ninja._currentSelectedContainer; } @@ -50,6 +51,10 @@ exports.SelectionController = Montage.create(Component, { } }, + ignoreFlag: { + value: true + }, + _selectedElements: { value: null }, @@ -91,10 +96,14 @@ exports.SelectionController = Montage.create(Component, { handleChange: { value: function() { - if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) { - if(this.currentDocument.model.getProperty("domContainer") !== null) { - this.executeSelectElement(); + if(this.ignoreFlag) { + if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) { + if(this.currentDocument.model.getProperty("domContainer") !== null) { + this.executeSelectElement(); + } } + } else { + this.ignoreFlag = true; } } }, -- cgit v1.2.3