diff options
author | Pushkar Joshi | 2012-04-27 15:05:38 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-04-27 15:05:38 -0700 |
commit | c8fc8e1bd1c394f433b4fc1677f4bc596e7cc2cc (patch) | |
tree | 74fcb9818a917d4f8ddb0db0c78a8cff9af86339 /js/panels/Materials/materials-popup.reel | |
parent | 28d1594b868e3c08e5603adbd5b29df1e24d57e9 (diff) | |
parent | c8fac64d4ad8ac18744a17a5e0f0d17204355fd6 (diff) | |
download | ninja-c8fc8e1bd1c394f433b4fc1677f4bc596e7cc2cc.tar.gz |
Merge branch 'master' into pentool
Diffstat (limited to 'js/panels/Materials/materials-popup.reel')
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.html | 18 | ||||
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.js | 21 |
2 files changed, 16 insertions, 23 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.html b/js/panels/Materials/materials-popup.reel/materials-popup.html index ae0ee2c8..9fdbc00d 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.html +++ b/js/panels/Materials/materials-popup.reel/materials-popup.html | |||
@@ -14,32 +14,28 @@ | |||
14 | <script type="text/montage-serialization"> | 14 | <script type="text/montage-serialization"> |
15 | { | 15 | { |
16 | "okButton": { | 16 | "okButton": { |
17 | "module": "montage/ui/button.reel", | 17 | "prototype": "montage/ui/button.reel", |
18 | "name": "Button", | ||
19 | "properties": { | 18 | "properties": { |
20 | "element": {"#": "mp_ok_btn"}, | 19 | "element": {"#": "mp_ok_btn"}, |
21 | "label": "OK" | 20 | "label": "OK" |
22 | } | 21 | } |
23 | }, | 22 | }, |
24 | "cancelButton": { | 23 | "cancelButton": { |
25 | "module": "montage/ui/button.reel", | 24 | "prototype": "montage/ui/button.reel", |
26 | "name": "Button", | ||
27 | "properties": { | 25 | "properties": { |
28 | "element": {"#": "mp_cancel_btn"}, | 26 | "element": {"#": "mp_cancel_btn"}, |
29 | "label": "Cancel" | 27 | "label": "Cancel" |
30 | } | 28 | } |
31 | }, | 29 | }, |
32 | "eventDelegator": { | 30 | "eventDelegator": { |
33 | "module": "montage/core/event/action-event-listener", | 31 | "prototype": "montage/core/event/action-event-listener", |
34 | "name": "ActionEventListener", | ||
35 | "properties": { | 32 | "properties": { |
36 | "handler": {"@": "owner"}, | 33 | "handler": {"@": "owner"}, |
37 | "action": "updatePreview" | 34 | "action": "updatePreview" |
38 | } | 35 | } |
39 | }, | 36 | }, |
40 | "propControl1": { | 37 | "propControl1": { |
41 | "module": "js/components/ui/property-control.reel", | 38 | "prototype": "js/components/ui/property-control.reel", |
42 | "name": "PropertyControl", | ||
43 | "properties": { | 39 | "properties": { |
44 | "element": {"#": "mp_property"} | 40 | "element": {"#": "mp_property"} |
45 | }, | 41 | }, |
@@ -64,8 +60,7 @@ | |||
64 | ] | 60 | ] |
65 | }, | 61 | }, |
66 | "materialsProperties": { | 62 | "materialsProperties": { |
67 | "module": "montage/ui/repetition.reel", | 63 | "prototype": "montage/ui/repetition.reel", |
68 | "name": "Repetition", | ||
69 | "properties": { | 64 | "properties": { |
70 | "element": {"#": "mp_properties_list"} | 65 | "element": {"#": "mp_properties_list"} |
71 | }, | 66 | }, |
@@ -78,8 +73,7 @@ | |||
78 | } | 73 | } |
79 | }, | 74 | }, |
80 | "owner": { | 75 | "owner": { |
81 | "module": "js/panels/Materials/materials-popup.reel", | 76 | "prototype": "js/panels/Materials/materials-popup.reel", |
82 | "name": "MaterialsPopup", | ||
83 | "properties": { | 77 | "properties": { |
84 | "materialsProperties": {"@": "materialsProperties"}, | 78 | "materialsProperties": {"@": "materialsProperties"}, |
85 | "element": {"#": "materials_popup"}, | 79 | "element": {"#": "materials_popup"}, |
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index bbccf45d..bd10f7a5 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -214,10 +214,9 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
214 | enumerable: true, | 214 | enumerable: true, |
215 | value: function(materialID) | 215 | value: function(materialID) |
216 | { | 216 | { |
217 | // Note that setting Array.length = 0 will empty arrays, | 217 | //TODO - Hack to force repetition to draw. Setting .length = 0 did not work. |
218 | // which is fine if you use getMaterialData to get a new array, but not for the | 218 | this.materialsData = []; |
219 | // dummyData arrays. | 219 | |
220 | this._materialsData.length = 0; | ||
221 | this._materialName = materialID; | 220 | this._materialName = materialID; |
222 | if( | 221 | if( |
223 | (materialID === "UberMaterial") || | 222 | (materialID === "UberMaterial") || |
@@ -231,16 +230,14 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
231 | if (material) | 230 | if (material) |
232 | { | 231 | { |
233 | this._material = material; | 232 | this._material = material; |
234 | var matData = this.getMaterialData( material ); | 233 | this.materialsData = this.getMaterialData( material ); |
235 | this.materialsData = matData; | ||
236 | } | 234 | } |
237 | } | 235 | } |
238 | else | 236 | else |
239 | { | 237 | { |
240 | this.materialsData = this._dummyData1.slice(0); | 238 | this.materialsData = this[materialID]; |
241 | } | 239 | } |
242 | 240 | this.needsDraw = true; | |
243 | this.needsDraw = true; | ||
244 | } | 241 | } |
245 | }, | 242 | }, |
246 | 243 | ||
@@ -445,7 +442,8 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
445 | } | 442 | } |
446 | }, | 443 | }, |
447 | 444 | ||
448 | _dummyData1: { | 445 | // _dummyData1 |
446 | CheckerBoard: { | ||
449 | value: [ | 447 | value: [ |
450 | { | 448 | { |
451 | "label": "Texture1", | 449 | "label": "Texture1", |
@@ -588,7 +586,8 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
588 | ] | 586 | ] |
589 | }, | 587 | }, |
590 | 588 | ||
591 | _dummyData2: { | 589 | // _dummyData2 |
590 | ShinyMetal: { | ||
592 | value: [ | 591 | value: [ |
593 | { | 592 | { |
594 | "label": "Diffuse", | 593 | "label": "Diffuse", |