aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/properties.reel')
-rwxr-xr-xjs/panels/properties.reel/properties.css5
-rwxr-xr-xjs/panels/properties.reel/properties.js43
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js29
-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.js16
5 files changed, 107 insertions, 14 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 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 {
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js
index ac316907..876fe110 100755
--- a/js/panels/properties.reel/sections/custom.reel/custom.js
+++ b/js/panels/properties.reel/sections/custom.reel/custom.js
@@ -15,6 +15,7 @@ var ColorSelect = require("js/panels/properties.reel/sections/custom-rows/color-
15 15
16// Components Needed to make this work 16// Components Needed to make this work
17var Hottext = require("js/components/hottextunit.reel").HotTextUnit; 17var Hottext = require("js/components/hottextunit.reel").HotTextUnit;
18var HT = require("js/components/hottext.reel").HotText;
18var Dropdown = require("js/components/combobox.reel").Combobox; 19var Dropdown = require("js/components/combobox.reel").Combobox;
19var TextField = require("js/components/textfield.reel").TextField; 20var TextField = require("js/components/textfield.reel").TextField;
20var FileInput = require("js/components/ui/file-input.reel").FileInput; 21var FileInput = require("js/components/ui/file-input.reel").FileInput;
@@ -168,6 +169,7 @@ exports.CustomSection = Montage.create(Component, {
168 value: function(fields) { 169 value: function(fields) {
169 switch(fields.type) { 170 switch(fields.type) {
170 case "hottext" : return this.createHottext(fields); 171 case "hottext" : return this.createHottext(fields);
172 case "ht" : return this.createHT(fields);
171 case "dropdown" : return this.createDropdown(fields); 173 case "dropdown" : return this.createDropdown(fields);
172 case "textbox" : return this.createTextField(fields); 174 case "textbox" : return this.createTextField(fields);
173 case "file" : return this.createFileInput(fields); 175 case "file" : return this.createFileInput(fields);
@@ -178,6 +180,33 @@ exports.CustomSection = Montage.create(Component, {
178 } 180 }
179 }, 181 },
180 182
183 createHT: {
184 value: function(aField) {
185
186 // Generate Hottext
187 var obj = HT.create();
188
189 // Set Values for HottextRow
190 if (aField.id) obj.id = aField.id;
191 if (aField.value) obj.value = aField.value;
192 if (aField.min) obj._minValue = aField.min;
193 if (aField.max) obj._maxValue = aField.max;
194 if (aField.prop) obj.prop = aField.prop;
195
196 //Initiate onChange Events
197 obj.addEventListener("change", this, false);
198 obj.addEventListener("changing", this, false);
199
200 //Bind object value to controls list so it can be manipulated
201 Object.defineBinding(this.controls, aField.id, {