diff options
author | Nivesh Rajbhandari | 2012-04-16 15:07:16 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-16 15:07:16 -0700 |
commit | 60d6346a78fb5257eaf36f17a5fcb764a342c012 (patch) | |
tree | 17e9d177aee294cdd25a6869cc33837681385e46 /js/panels | |
parent | 4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff) | |
download | ninja-60d6346a78fb5257eaf36f17a5fcb764a342c012.tar.gz |
Fixed materials editor popup not refreshing correctly.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/panels')
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.js | 21 |
1 files changed, 10 insertions, 11 deletions
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", |