aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel/sections
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/properties.reel/sections')
-rwxr-xr-xjs/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js8
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js86
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.css32
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.html13
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.js10
-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
7 files changed, 174 insertions, 19 deletions
diff --git a/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js b/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js
index 72d216ca..4c5c80d7 100755
--- a/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js
+++ b/js/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js
@@ -43,7 +43,13 @@ exports.DualRow = Montage.create(Component, {
43 this.element.getElementsByClassName("lbl")[0].innerHTML = this.label + ":"; 43 this.element.getElementsByClassName("lbl")[0].innerHTML = this.label + ":";
44 } 44 }
45 if(this.label2 !== null) { 45 if(this.label2 !== null) {
46 this.element.getElementsByClassName("lbl")[1].innerHTML = this.label2 + ":"; 46 if(this.content2.type === "button") {
47 this.content2.element = document.createElement("button");
48 this.content2.element.classList.add("nj-skinned");
49 this.element.getElementsByClassName("lbl")[1].style.display = "none";
50 } else {
51 this.element.getElementsByClassName("lbl")[1].innerHTML = this.label2 + ":";
52 }
47 } else { 53 } else {
48 this.element.getElementsByClassName("lbl")[1].style.display = "none"; 54 this.element.getElementsByClassName("lbl")[1].style.display = "none";
49 } 55 }
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js
index 3c595980..876fe110 100755
--- a/js/panels/properties.reel/sections/custom.reel/custom.js
+++ b/js/panels/properties.reel/sections/custom.reel/custom.js
@@ -15,11 +15,13 @@ 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;
21var Checkbox = require("js/components/checkbox.reel").Checkbox; 22var Checkbox = require("js/components/checkbox.reel").Checkbox;
22var ColorChip = require("js/components/ui/color-chip.reel").ColorChip; 23var ColorChip = require("js/components/ui/color-chip.reel").ColorChip;
24var Button = require("montage/ui/button.reel").Button;
23 25
24exports.CustomSection = Montage.create(Component, { 26exports.CustomSection = Montage.create(Component, {
25 27
@@ -128,6 +130,15 @@ exports.CustomSection = Montage.create(Component, {
128 } 130 }
129 }, 131 },
130 132
133 handleAction: {
134 value:function(event) {
135 if(event._event.wasSetByCode) return;
136
137 var obj = event.currentTarget;
138 this._dispatchPropEvent({"type": "change", "id": obj.id, "prop": obj.prop, "value": obj.value, "control": obj});
139 }
140 },
141
131 _dispatchPropEvent: { 142 _dispatchPropEvent: {
132 value: function(event) { 143 value: function(event) {
133// console.log(event); 144// console.log(event);
@@ -158,15 +169,44 @@ exports.CustomSection = Montage.create(Component, {
158 value: function(fields) { 169 value: function(fields) {
159 switch(fields.type) { 170 switch(fields.type) {
160 case "hottext" : return this.createHottext(fields); 171 case "hottext" : return this.createHottext(fields);
172 case "ht" : return this.createHT(fields);
161 case "dropdown" : return this.createDropdown(fields); 173 case "dropdown" : return this.createDropdown(fields);
162 case "textbox" : return this.createTextField(fields); 174 case "textbox" : return this.createTextField(fields);
163 case "file" : return this.createFileInput(fields); 175 case "file" : return this.createFileInput(fields);
164 case "checkbox" : return this.createCheckbox(fields); 176 case "checkbox" : return this.createCheckbox(fields);
165 case "chip" : return this.createColorChip(fields); 177 case "chip" : return this.createColorChip(fields);
178 case "button" : return this.createButton(fields);
166 } 179 }
167 } 180 }
168 }, 181 },
169 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, {
202 boundObject: obj,
203 boundObjectPropertyPath: "value"
204 });
205
206 return obj;
207 }
208 },
209
170 //Breaking Up Switch Case Statement to functions to return a row 210 //Breaking Up Switch Case Statement to functions to return a row
171 createHottext: { 211 createHottext: {
172 value: function(aField) { 212 value: function(aField) {
@@ -317,6 +357,19 @@ exports.CustomSection = Montage.create(Component, {
317 if (aField.value) obj.label = aField.value; 357 if (aField.value) obj.label = aField.value;
318 if (aField.prop) obj.prop = aField.prop; 358 if (aField.prop) obj.prop = aField.prop;
319 359
360 if (aField.enabled) {
361 if(aField.enabled.boundObject) {
362 // TODO - For now, always bind to this.controls[someProperty]
363 Object.defineBinding(obj, "enabled", {
364 boundObject: this.controls,
365 boundObjectPropertyPath: aField.enabled.boundProperty,
366 oneway: false
367 });
368 } else {
369 obj.enabled = aField.enabled;
370 }
371 }
372
320 //Initiate onChange Events 373 //Initiate onChange Events
321 obj.addEventListener("change", this, false); 374 obj.addEventListener("change", this, false);
322 375
@@ -351,6 +404,39 @@ exports.CustomSection = Montage.create(Component, {
351 404
352 return obj; 405 return obj;
353 } 406 }
407 },
408
409 createButton: {
410 value: function(aField) {
411 var obj = Button.create();
412
413 // Set Values for Button
414 if (aField.id) obj.id = aField.id;
415 if (aField.label) obj.label = aField.label;
416 if (aField.prop) obj.prop = aField.prop;
417
418 // Special casing button so slot uses "button" tag instead of "div"
419 obj.type = "button";
420
421 if (aField.enabled) {
422 if(aField.enabled.boundObject) {
423 // TODO - For now, always bind to this.controls[someProperty]
424 Object.defineBinding(obj, "enabled", {
425 boundObject: this.controls,
426 boundObjectPropertyPath: aField.enabled.boundProperty,
427 oneway: true
428 });
429 } else {
430 obj.enabled = aField.enabled;
431 }
432 }
433
434 obj.addEventListener("action", this, false);
435
436 this.controls[aField.id] = obj;
437
438 return obj;
439 }
354 } 440 }
355 441
356}); \ No newline at end of file 442}); \ No newline at end of file
diff --git a/js/panels/properties.reel/sections/position-and-size.reel/position-and-size.css b/js/panels/properties.reel/sections/position-and-size.reel/position-and-size.css
index 227a232b..7f8fdbc2 100755
--- a/js/panels/properties.reel/sections/position-and-size.reel/position-and-size.css
+++ b/js/panels/properties.reel/sections/position-and-size.reel/position-and-size.css
@@ -8,7 +8,33 @@
8 display: none; 8 display: none;
9} 9}
10 10
11.fieldCol .disabled 11.fieldCol .disabled {
12{
13 color:#999999; 12 color:#999999;
14} \ No newline at end of file 13}
14
15
16#posBound {
17 position: absolute;
18 left: 105px;
19 border: none;