aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel/properties.js
diff options
context:
space:
mode:
authorhwc4872012-04-19 13:01:43 -0700
committerhwc4872012-04-19 13:01:43 -0700
commite6a20fe64574763483dc602bd759278ccf5e5e68 (patch)
tree69defe7200206f0257fe90697136fadef59d521e /js/panels/properties.reel/properties.js
parentae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff)
parent9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff)
downloadninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/lib/drawing/world.js js/lib/geom/geom-obj.js js/lib/rdge/materials/cloud-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/panels/properties.reel/properties.js')
-rwxr-xr-xjs/panels/properties.reel/properties.js43
1 files changed, 32 insertions, 11 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index 40e9b86a..d9dca538 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -87,7 +87,7 @@ exports.Properties = Montage.create(Component, {
87 this.displayStageProperties(); 87 this.displayStageProperties();
88 } else { 88 } else {
89 if(this.application.ninja.selectedElements.length === 1) { 89 if(this.application.ninja.selectedElements.length === 1) {
90 this.displayElementProperties(this.application.ninja.selectedElements[0]._element); 90 this.displayElementProperties(this.application.ninja.selectedElements[0]);
91 } else { 91 } else {
92 this.displayGroupProperties(this.application.ninja.selectedElements); 92 this.displayGroupProperties(this.application.ninja.selectedElements);
93 } 93 }
@@ -113,14 +113,14 @@ exports.Properties = Montage.create(Component, {
113 } 113 }
114 114
115 if(this.application.ninja.selectedElements.length) { 115 if(this.application.ninja.selectedElements.length) {
116 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); 116// ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi");
117 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi");
117 } else { 118 } else {
118 ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id); 119 ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id);
119 } 120 }
120 } else if(event.target.id === "elementClass") { 121 } else if(event.target.id === "elementClass") {
121 if(this.application.ninja.selectedElements.length) { 122 if(this.application.ninja.selectedElements.length) {
122 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, "Change", "pi"); 123 ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi");
123 console.log(this.application.ninja.selectedElements[0]._element.className);
124 } else { 124 } else {
125 ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); 125 ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass);
126 } 126 }
@@ -138,8 +138,8 @@ exports.Properties = Montage.create(Component, {
138 138
139 handleElementChanging: { 139 handleElementChanging: {
140 value: function(event) { 140 value: function(event) {
141// this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "left")); 141// this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0], "left"));
142// this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "top")); 142// this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0], "top"));
143 } 143 }
144 }, 144 },
145 145
@@ -147,24 +147,27 @@ exports.Properties = Montage.create(Component, {
147 value: function(event) { 147 value: function(event) {
148// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update 148// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update
149 if(event.detail.source && event.detail.source !== "pi") { 149 if(event.detail.source && event.detail.source !== "pi") {
150 var el = this.application.ninja.currentDocument.documentRoot;
151 if(this.application.ninja.selectedElements.length) {
152 el = this.application.ninja.selectedElements[0];
153 }
154
150 // TODO - This should only update the properties that were changed. 155 // TODO - This should only update the properties that were changed.
151 var el = this.application.ninja.selectedElements[0]._element || this.application.ninja.selectedElements[0];
152 this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left")); 156 this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left"));
153 this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top")); 157 this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top"));
154 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); 158 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height"));
155 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); 159 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width"));
156 160
157 if(this.threeD.inGlobalMode) 161 if(this.threeD.inGlobalMode) {
158 {
159 this.threeD.x3D = ElementsMediator.get3DProperty(el, "x3D"); 162 this.threeD.x3D = ElementsMediator.get3DProperty(el, "x3D");
160 this.threeD.y3D = ElementsMediator.get3DProperty(el, "y3D"); 163 this.threeD.y3D = ElementsMediator.get3DProperty(el, "y3D");
161 this.threeD.z3D = ElementsMediator.get3DProperty(el, "z3D"); 164 this.threeD.z3D = ElementsMediator.get3DProperty(el, "z3D");
162 this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle"); 165 this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle");
163 this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle"); 166 this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle");
164 this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle"); 167 this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle");
168 }
165 } 169 }
166 } 170 }
167 }
168 }, 171 },
169 172
170 handleSelectionChange: { 173 handleSelectionChange: {
@@ -173,7 +176,7 @@ exports.Properties = Montage.create(Component, {
173 this.displayStageProperties(); 176 this.displayStageProperties();
174 } else { 177 } else {
175 if(this.application.ninja.selectedElements.length === 1) { 178 if(this.application.ninja.selectedElements.length === 1) {
176 this.displayElementProperties(this.application.ninja.selectedElements[0]._element); 179 this.displayElementProperties(this.application.ninja.selectedElements[0]);
177 } else { 180 } else {
178 this.displayGroupProperties(this.application.ninja.selectedElements); 181 this.displayGroupProperties(this.application.ninja.selectedElements);
179 } 182 }
@@ -196,6 +199,19 @@ exports.Properties = Montage.create(Component, {
196 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height")); 199 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height"));
197 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); 200 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width"));
198 201
202 if(this.threeD.inGlobalMode)
203 {
204 this.threeD.xAngle = ElementsMediator.get3DProperty(stage, "xAngle");
205 this.threeD.yAngle = ElementsMediator.get3DProperty(stage, "yAngle");
206 this.threeD.zAngle = ElementsMediator.get3DProperty(stage, "zAngle");
207 }
208
209 if(ElementsMediator.getProperty(stage, "-webkit-transform-style") === "preserve-3d") {
210 this.threeD.flatten = false;
211 } else {
212 this.threeD.flatten = true;
213 }
214
199 if(this.customPi !== stage.elementModel.pi) { 215 if(this.customPi !== stage.elementModel.pi) {
200 // We need to unregister color chips from the previous selection from the Color Model 216 // We need to unregister color chips from the previous selection from the Color Model
201 var len = this.customSections.length; 217 var len = this.customSections.length;
@@ -260,6 +276,11 @@ exports.Properties = Montage.create(Component, {
260 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); 276 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height"));
261 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); 277 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width"));
262 278
279 if(ElementsMediator.getProperty(el, "-webkit-transform-style") === "preserve-3d") {
280 this.threeD.flatten = false;
281 } else {
282 this.threeD.flatten = true;
283 }
263 284
264 if(this.threeD.inGlobalMode) 285 if(this.threeD.inGlobalMode)
265 { 286 {