aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel
diff options
context:
space:
mode:
authorEric Guzman2012-04-09 15:44:09 -0700
committerEric Guzman2012-04-09 15:44:09 -0700
commita27915e900eb768dd9db1f0dd441961ea80bfaa6 (patch)
tree593f429f0b3294103a059ae9f6ed03858288deb7 /js/panels/properties.reel
parentafcaa157f7bc067cf00de91b43b2a71e9b64b7b3 (diff)
parentbd43ce383b050d03b0f92cc923c517febc66ca28 (diff)
downloadninja-a27915e900eb768dd9db1f0dd441961ea80bfaa6.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Diffstat (limited to 'js/panels/properties.reel')
-rwxr-xr-xjs/panels/properties.reel/properties.css5
-rwxr-xr-xjs/panels/properties.reel/properties.js24
-rwxr-xr-xjs/panels/properties.reel/sections/three-d-view.reel/three-d-view.html28
-rwxr-xr-xjs/panels/properties.reel/sections/three-d-view.reel/three-d-view.js14
4 files changed, 68 insertions, 3 deletions
diff --git a/js/panels/properties.reel/properties.css b/js/panels/properties.reel/properties.css
index f82d3660..0928da3a 100755
--- a/js/panels/properties.reel/properties.css
+++ b/js/panels/properties.reel/properties.css
@@ -47,6 +47,11 @@ padding-right:6px;
47 47
48} 48}
49 49
50.propertiesPanel button.nj-skinned {
51 margin-left: -12px;
52 margin-top: -3px;
53}
54
50.propertiesPanel hr { 55.propertiesPanel hr {
51 border: 0; 56 border: 0;
52 border-top: 1px solid #3c3c3c; 57 border-top: 1px solid #3c3c3c;
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index d5acd503..625e3eb6 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -146,8 +146,12 @@ exports.Properties = Montage.create(Component, {
146 value: function(event) { 146 value: function(event) {
147// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update 147// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update
148 if(event.detail.source && event.detail.source !== "pi") { 148 if(event.detail.source && event.detail.source !== "pi") {
149 var el = this.application.ninja.currentDocument.documentRoot;
150 if(this.application.ninja.selectedElements.length) {
151 el = this.application.ninja.selectedElements[0];
152 }
153
149 // TODO - This should only update the properties that were changed. 154 // TODO - This should only update the properties that were changed.
150 var el = this.application.ninja.selectedElements[0];
151 this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left")); 155 this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left"));
152 this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top")); 156 this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top"));
153 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); 157 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height"));
@@ -194,6 +198,19 @@ exports.Properties = Montage.create(Component, {
194 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height")); 198 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height"));
195 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); 199 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width"));
196 200
201 if(this.threeD.inGlobalMode)
202 {
203 this.threeD.xAngle = ElementsMediator.get3DProperty(stage, "xAngle");
204 this.threeD.yAngle = ElementsMediator.get3DProperty(stage, "yAngle");
205 this.threeD.zAngle = ElementsMediator.get3DProperty(stage, "zAngle");
206 }
207
208 if(ElementsMediator.getProperty(stage, "-webkit-transform-style") === "preserve-3d") {
209 this.threeD.flatten = false;
210 } else {
211 this.threeD.flatten = true;
212 }
213
197 if(this.customPi !== stage.elementModel.pi) { 214 if(this.customPi !== stage.elementModel.pi) {
198 // We need to unregister color chips from the previous selection from the Color Model 215 // We need to unregister color chips from the previous selection from the Color Model
199 var len = this.customSections.length; 216 var len = this.customSections.length;
@@ -258,6 +275,11 @@ exports.Properties = Montage.create(Component, {
258 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); 275 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height"));
259 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); 276 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width"));
260 277
278 if(ElementsMediator.getProperty(el, "-webkit-transform-style") === "preserve-3d") {
279 this.threeD.flatten = false;
280 } else {
281 this.threeD.flatten = true;
282 }
261 283
262 if(this.threeD.inGlobalMode) 284 if(this.threeD.inGlobalMode)
263 { 285 {
diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html
index 18a7369e..b6c25baf 100755
--- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html
+++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html
@@ -22,7 +22,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
22 "xAngleControl": {"@": "threeDRotX"}, 22 "xAngleControl": {"@": "threeDRotX"},
23 "yAngleControl": {"@": "threeDRotY"}, 23 "yAngleControl": {"@": "threeDRotY"},
24 "zAngleControl": {"@": "threeDRotZ"}, 24 "zAngleControl": {"@": "threeDRotZ"},
25 "axisModeGroupControl": {"@": "axisModeGroup"} 25 "axisModeGroupControl": {"@": "axisModeGroup"},
26 "flattenControl": {"@": "flattenCheckbox"}
26 } 27 }
27 }, 28 },
28 29
@@ -242,6 +243,29 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
242 "value": "Global", 243 "value": "Global",
243 "group": {"@": "axisModeGroup"} 244 "group": {"@": "axisModeGroup"}
244 } 245 }
246 },
247 "flattenCheckbox": {
248 "module": "montage/ui/checkbox.reel",
249 "name": "Checkbox",
250 "properties": {
251 "element": {"#": "flattenCh"},
252 "identifier": "flatten",
253 "checked": false
254 },
255 "bindings": {
256 "checked": {
257 "boundObject": {"@": "owner"},
258 "boundObjectPropertyPath": "flatten",
259 "oneway": false
260 }
261 },
262 "listeners": [
263 {
264 "type": "action",
265 "listener": {"@": "owner"},
266 "capture": false
267 }
268 ]
245 } 269 }
246 } 270 }
247 </script> 271 </script>
@@ -335,7 +359,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
335 <article class="fieldRow oneCol checkbox"> 359 <article class="fieldRow oneCol checkbox">
336 <div> 360 <div>
337 <div class="inputField"> 361 <div class="inputField">
338 <input class="nj-skinned" type="checkbox" /> 362 <input id="flattenCh" class="nj-skinned" type="checkbox" />
339 </div> 363 </div>
340 <div> 364 <div>
341 <label> Flatten</label> 365 <label> Flatten</label>
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 f72d1ff6..dcba51a4 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
@@ -79,6 +79,10 @@ exports.ThreeD = Montage.create(Component, {
79 value: 0 79 value: 0
80 }, 80 },
81 81
82 flatten: {
83 value: false
84 },
85
82 _disableTranslation: { 86 _disableTranslation: {
83 value: true 87 value: true
84 }, 88 },
@@ -107,6 +111,16 @@ exports.ThreeD = Montage.create(Component, {
107 value: null 111 value: null
108 }, 112 },
109 113
114 handleAction: {
115 value: function(event) {
116 if(event.currentTarget.identifier === "flatten") {
117 this.application.ninja.elementMediator.setProperty([this.item],
118 "-webkit-transform-style",
119 event.currentTarget.checked ? ["flat"] : ["preserve-3d"]);
120 }
121 }
122 },
123
110 handleChange: { 124 handleChange: {
111 value: function(event) { 125 value: function(event) {
112 if(event.wasSetByCode) { 126 if(event.wasSetByCode) {