aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-12 15:12:52 -0700
committerValerio Virgillito2012-06-12 15:12:52 -0700
commit52ca1c95d6f000503f44fa5f3139557e770a7773 (patch)
tree56d607f8ef73bf407f84eb66d3e578b3dc16230b /js/controllers
parent16d859a284805cd8bf14187fd421b6a14e6d8912 (diff)
downloadninja-52ca1c95d6f000503f44fa5f3139557e770a7773.tar.gz
hack fix for the PI section throwing errors when dom is not ready to draw
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/selection-controller.js15
1 files changed, 12 insertions, 3 deletions
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, {
34 } 34 }
35 35
36 if(this._currentDocument && this._currentDocument.currentView === "design") { 36 if(this._currentDocument && this._currentDocument.currentView === "design") {
37 this.ignoreFlag = false;
37 this._currentDocument.model._selection = this.application.ninja.selectedElements; 38 this._currentDocument.model._selection = this.application.ninja.selectedElements;
38// this._currentDocument.model.selectionContainer = this.application.ninja._currentSelectedContainer; 39// this._currentDocument.model.selectionContainer = this.application.ninja._currentSelectedContainer;
39 } 40 }
@@ -50,6 +51,10 @@ exports.SelectionController = Montage.create(Component, {
50 } 51 }
51 }, 52 },
52 53
54 ignoreFlag: {
55 value: true
56 },
57
53 _selectedElements: { 58 _selectedElements: {
54 value: null 59 value: null
55 }, 60 },
@@ -91,10 +96,14 @@ exports.SelectionController = Montage.create(Component, {
91 96
92 handleChange: { 97 handleChange: {
93 value: function() { 98 value: function() {
94 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) { 99 if(this.ignoreFlag) {
95 if(this.currentDocument.model.getProperty("domContainer") !== null) { 100 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) {
96 this.executeSelectElement(); 101 if(this.currentDocument.model.getProperty("domContainer") !== null) {
102 this.executeSelectElement();
103 }
97 } 104 }
105 } else {
106 this.ignoreFlag = true;
98 } 107 }
99 } 108 }
100 }, 109 },