aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel
diff options
context:
space:
mode:
authorArmen Kesablyan2012-05-25 11:22:58 -0700
committerArmen Kesablyan2012-05-25 11:22:58 -0700
commit81239571c538f72e398fafa5b07725bf1bbb2d5d (patch)
treed31c876f5af61565eff8c934c9e5f119696d46e0 /js/panels/properties.reel
parente8c4e98c24092a360eb2f637983fd104fbb67f66 (diff)
parent9c8d724dd1605ee2e5257591e0bfaad575cbc906 (diff)
downloadninja-81239571c538f72e398fafa5b07725bf1bbb2d5d.tar.gz
Merge branch 'refs/heads/dom-architecture' into binding
Diffstat (limited to 'js/panels/properties.reel')
-rwxr-xr-xjs/panels/properties.reel/properties.js12
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js2
-rwxr-xr-xjs/panels/properties.reel/sections/position-size.reel/position-size.js8
-rwxr-xr-xjs/panels/properties.reel/sections/three-d-view.reel/three-d-view.js2
4 files changed, 12 insertions, 12 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index b292a66a..e3ecce10 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -73,7 +73,7 @@ exports.Properties = Montage.create(Component, {
73 this.application.ninja.currentDocument.model.views.design.propertiesPanel = this; 73 this.application.ninja.currentDocument.model.views.design.propertiesPanel = this;
74 74
75 // Display the default document root PI 75 // Display the default document root PI
76 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); 76 this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot);
77 } 77 }
78 }, 78 },
79 79
@@ -95,7 +95,7 @@ exports.Properties = Montage.create(Component, {
95 this.elementId.value = this.elementId.value.replace(/\s/g, ''); 95 this.elementId.value = this.elementId.value.replace(/\s/g, '');
96 96
97 // Check if that id is in use 97 // Check if that id is in use
98 if(this.application.ninja.currentDocument._document.getElementById(this.elementId.value) !== null) { 98 if(this.application.ninja.currentDocument.model.views.design.document.getElementById(this.elementId.value) !== null) {
99 // TODO: Replace with Ninja Alert 99 // TODO: Replace with Ninja Alert
100 alert("The following ID: " + this.elementId.value + " is already in use"); 100 alert("The following ID: " + this.elementId.value + " is already in use");
101 } 101 }
@@ -104,13 +104,13 @@ exports.Properties = Montage.create(Component, {
104// ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); 104// ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi");
105 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi"); 105 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi");
106 } else { 106 } else {
107 ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id); 107 ElementsMediator.setAttribute(this.application.ninja.currentDocument.model.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.model.documentRoot.elementModel.id);
108 } 108 }
109 } else if(event.target.id === "elementClass") { 109 } else if(event.target.id === "elementClass") {
110 if(this.application.ninja.selectedElements.length) { 110 if(this.application.ninja.selectedElements.length) {
111 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi"); 111 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi");
112 } else { 112 } else {
113 ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); 113 ElementsMediator.setAttribute(this.application.ninja.currentDocument.model.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.model.documentRoot.elementModel.elementClass);
114 } 114 }
115 } 115 }
116 } 116 }
@@ -135,7 +135,7 @@ exports.Properties = Montage.create(Component, {
135 value: function(event) { 135 value: function(event) {
136// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update 136// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update
137 if(event.detail.source && event.detail.source !== "pi") { 137 if(event.detail.source && event.detail.source !== "pi") {
138 var el = this.application.ninja.currentDocument.documentRoot; 138 var el = this.application.ninja.currentDocument.model.documentRoot;
139 if(this.application.ninja.selectedElements.length) { 139 if(this.application.ninja.selectedElements.length) {
140 el = this.application.ninja.selectedElements[0]; 140 el = this.application.ninja.selectedElements[0];
141 } 141 }
@@ -161,7 +161,7 @@ exports.Properties = Montage.create(Component, {
161 handleSelectionChange: { 161 handleSelectionChange: {
162 value: function(event) { 162 value: function(event) {
163 if(event.detail.isDocument) { 163 if(event.detail.isDocument) {
164 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); 164 this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot);
165 } else { 165 } else {
166 if(this.application.ninja.selectedElements.length === 1) { 166 if(this.application.ninja.selectedElements.length === 1) {
167 this.displayElementProperties(this.application.ninja.selectedElements[0]); 167 this.displayElementProperties(this.application.ninja.selectedElements[0]);
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js
index b1fd910d..ae408f11 100755
--- a/js/panels/properties.reel/sections/custom.reel/custom.js
+++ b/js/panels/properties.reel/sections/custom.reel/custom.js
@@ -116,7 +116,7 @@ exports.CustomSection = Montage.create(Component, {
116 value: function(event) { 116 value: function(event) {
117 // Change the stage color for now 117 // Change the stage color for now
118 //console.log(this, event); 118 //console.log(this, event);
119 ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); 119 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, [event._event.color.css], "Change", "pi", '');
120 /* 120 /*
121 var propEvent = document.createEvent("CustomEvent"); 121 var propEvent = document.createEvent("CustomEvent");
122 propEvent.initEvent("propertyChange", true, true); 122 propEvent.initEvent("propertyChange", true, true);
diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.js b/js/panels/properties.reel/sections/position-size.reel/position-size.js
index 10e084be..7c24e02a 100755
--- a/js/panels/properties.reel/sections/position-size.reel/position-size.js
+++ b/js/panels/properties.reel/sections/position-size.reel/position-size.js
@@ -158,7 +158,7 @@ exports.PositionSize = Montage.create(Component, {
158 if(!event.wasSetByCode) { 158 if(!event.wasSetByCode) {
159 if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; 159 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
160 160
161 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; 161 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot];
162 162
163 if(this.bindButton.pressed) { 163 if(this.bindButton.pressed) {
164 164
@@ -183,7 +183,7 @@ exports.PositionSize = Montage.create(Component, {
183 if(!event.wasSetByCode) { 183 if(!event.wasSetByCode) {
184 if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; 184 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
185 185
186 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; 186 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot];
187 187
188 if(this.bindButton.pressed) { 188 if(this.bindButton.pressed) {
189 189
@@ -231,7 +231,7 @@ exports.PositionSize = Montage.create(Component, {
231 231
232 if(!this.savedPosition) this.savedPosition = this.heightSize; 232 if(!this.savedPosition) this.savedPosition = this.heightSize;
233 233
234 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; 234 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot];
235 235
236 if(this.bindButton.pressed) { 236 if(this.bindButton.pressed) {
237 237
@@ -256,7 +256,7 @@ exports.PositionSize = Montage.create(Component, {
256 256
257 if(!this.savedPosition) this.savedPosition = this.widthSize; 257 if(!this.savedPosition) this.savedPosition = this.widthSize;
258 258
259 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; 259 this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot];
260 260
261 if(this.bindButton.pressed) { 261 if(this.bindButton.pressed) {
262 var newHeight = Math.round(this.aspectRatioWidth * this.widthControl.value); 262 var newHeight = Math.round(this.aspectRatioWidth * this.widthControl.value);
diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js
index dcba51a4..e16e3509 100755
--- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js
+++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js
@@ -247,7 +247,7 @@ exports.ThreeD = Montage.create(Component, {
247 if(els.length) { 247 if(els.length) {
248 return els[0]; 248 return els[0];
249 } else { 249 } else {
250 return this.boundObject.application.ninja.currentDocument.documentRoot; 250 return this.boundObject.application.ninja.currentDocument.model.documentRoot;
251 } 251 }
252 } 252 }
253 }, 253 },