aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-24 13:50:46 -0700
committerNivesh Rajbhandari2012-03-24 13:50:46 -0700
commitbda9f8f5829c943486f8850e68c991e83f8fb8c8 (patch)
tree0c524074cb8f1acb3bff38923e527fb267d9074c
parent1b7e627ae290dacec3a242445f3e6c5de302626a (diff)
downloadninja-bda9f8f5829c943486f8850e68c991e83f8fb8c8.tar.gz
Adding logic for flatten checkbox in PI.
This requires minor modifications to both StageController and ComponentController. Also removing unused global3DSettings CSS. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
-rwxr-xr-xjs/controllers/elements/component-controller.js2
-rwxr-xr-xjs/controllers/elements/stage-controller.js5
-rwxr-xr-xjs/document/templates/montage-html/default_html.css5
-rwxr-xr-xjs/document/templates/montage-html/index.html2
-rwxr-xr-xjs/panels/properties.reel/properties.js13
-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
7 files changed, 60 insertions, 9 deletions
diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js
index 83450d0f..fbe9a995 100755
--- a/js/controllers/elements/component-controller.js
+++ b/js/controllers/elements/component-controller.js
@@ -14,6 +14,7 @@ exports.ComponentController = Montage.create(ElementController, {
14 switch(prop) { 14 switch(prop) {
15 case "id": 15 case "id":
16 case "class": 16 case "class":
17 case "-webkit-transform-style":
17 case "left": 18 case "left":
18 case "top": 19 case "top":
19 case "width": 20 case "width":
@@ -34,6 +35,7 @@ exports.ComponentController = Montage.create(ElementController, {
34 switch(p) { 35 switch(p) {
35 case "id": 36 case "id":
36 case "class": 37 case "class":
38 case "-webkit-transform-style":
37 case "left": 39 case "left":
38 case "top": 40 case "top":
39 case "width": 41 case "width":
diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js
index 2734e226..f2c8fa2d 100755
--- a/js/controllers/elements/stage-controller.js
+++ b/js/controllers/elements/stage-controller.js
@@ -83,6 +83,8 @@ exports.StageController = Montage.create(ElementController, {
83 return el.elementModel.stageDimension.style.getProperty(p); 83 return el.elementModel.stageDimension.style.getProperty(p);
84 case "width": 84 case "width":
85 return el.elementModel.stageDimension.style.getProperty(p); 85 return el.elementModel.stageDimension.style.getProperty(p);
86 case "-webkit-transform-style":
87 return el.elementModel.stageView.style.getProperty(p);
86 default: 88 default:
87 return ElementController.getProperty(el, p, false, true); 89 return ElementController.getProperty(el, p, false, true);
88 //console.log("Undefined Stage property ", p); 90 //console.log("Undefined Stage property ", p);
@@ -111,6 +113,9 @@ exports.StageController = Montage.create(ElementController, {
111 this.application.ninja.currentDocument.iframe.height = parseInt(value) + 400; 113 this.application.ninja.currentDocument.iframe.height = parseInt(value) + 400;
112 el.elementModel.stageDimension.style.setProperty(p, value); 114 el.elementModel.stageDimension.style.setProperty(p, value);
113 break; 115 break;
116 case "-webkit-transform-style":
117 el.elementModel.stageView.style.setProperty(p, value);
118 break;
114 default: 119 default:
115 console.log("Undefined property ", p, "for the Stage Controller"); 120 console.log("Undefined property ", p, "for the Stage Controller");
116 } 121 }
diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css
index 68300edf..1cdd7114 100755
--- a/js/document/templates/montage-html/default_html.css
+++ b/js/document/templates/montage-html/default_html.css
@@ -65,11 +65,6 @@ body
65 display: none; 65 display: none;
66} 66}
67 67
68.global3DSettings {
69 -webkit-transform-style: preserve-3d;
70 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
71}
72
73.elem-red-outline { 68.elem-red-outline {
74 outline: red solid thin; 69 outline: red solid thin;
75} \ No newline at end of file 70} \ No newline at end of file
diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html
index edfab2b0..b3f68030 100755
--- a/js/document/templates/montage-html/index.html
+++ b/js/document/templates/montage-html/index.html
@@ -40,7 +40,7 @@
40 40
41 <ninja-div id="Viewport" class="stageDimension"> 41 <ninja-div id="Viewport" class="stageDimension">
42 42
43 <ninja-div id="UserContent" class="stageView stageDimension global3DSettings"></ninja-div> 43 <ninja-div id="UserContent" class="stageView stageDimension"></ninja-div>
44 44
45 </ninja-div> 45 </ninja-div>
46 46
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index 782dd138..ca720ae7 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -166,9 +166,9 @@ exports.Properties = Montage.create(Component, {
166 this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle"); 166 this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle");
167 this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle"); 167 this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle");
168 this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle"); 168 this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle");
169 }
170 } 169 }
171 } 170 }
171 }
172 }, 172 },
173 173
174 handleSelectionChange: { 174 handleSelectionChange: {
@@ -207,6 +207,12 @@ exports.Properties = Montage.create(Component, {
207 this.threeD.zAngle = ElementsMediator.get3DProperty(stage, "zAngle"); 207 this.threeD.zAngle = ElementsMediator.get3DProperty(stage, "zAngle");
208 } 208 }
209 209
210 if(ElementsMediator.getProperty(stage, "-webkit-transform-style") === "preserve-3d") {
211 this.threeD.flatten = false;
212 } else {
213 this.threeD.flatten = true;
214 }
215
210 if(this.customPi !== stage.elementModel.pi) { 216 if(this.customPi !== stage.elementModel.pi) {
211 // We need to unregister color chips from the previous selection from the Color Model 217 // We need to unregister color chips from the previous selection from the Color Model
212 var len = this.customSections.length; 218 var len = this.customSections.length;
@@ -271,6 +277,11 @@ exports.Properties = Montage.create(Component, {
271 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); 277 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height"));
272 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); 278 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width"));
273 279
280 if(ElementsMediator.getProperty(el, "-webkit-transform-style") === "preserve-3d") {
281 this.threeD.flatten = false;
282 } else {
283 this.threeD.flatten = true;
284 }
274 285
275 if(this.threeD.inGlobalMode) 286 if(this.threeD.inGlobalMode)
276 { 287 {
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 35591afa..0d3d111d 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</