diff options
author | Valerio Virgillito | 2012-02-29 12:09:43 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-29 12:09:43 -0800 |
commit | 3d233f25cff057fff5c5a75e4c4b40e88c22a8f5 (patch) | |
tree | 1ee8d228700cd37632f2213b260142b13aa69c70 /js/panels/properties | |
parent | 3dbe798285f95dc63ae33739df5daadb8c432f24 (diff) | |
parent | 209e0781e926212bbaaad9e8ca4b61a0c389b30f (diff) | |
download | ninja-3d233f25cff057fff5c5a75e4c4b40e88c22a8f5.tar.gz |
Merge branch 'NiveshColor' of https://github.com/mqg734/ninja-internal into integration-candidate
Diffstat (limited to 'js/panels/properties')
4 files changed, 51 insertions, 1 deletions
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index cc9ec96a..72c02ffd 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js | |||
@@ -172,6 +172,17 @@ exports.Content = Montage.create(Component, { | |||
172 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); | 172 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); |
173 | 173 | ||
174 | if(this.customPi !== stage.elementModel.pi) { | 174 | if(this.customPi !== stage.elementModel.pi) { |
175 | // We need to unregister color chips from the previous selection from the Color Model | ||
176 | var len = this.customSections.length; | ||
177 | for(var n = 0, controls; n < len; n++) { | ||
178 | controls = this.customSections[n].content.controls; | ||
179 | if(controls["colorSelect"]) { | ||
180 | controls["colorSelect"].destroy(); | ||
181 | } else if(controls["stageBackground"]) { | ||
182 | controls["stageBackground"].destroy(); | ||
183 | } | ||
184 | } | ||
185 | |||
175 | this.customPi = stage.elementModel.pi; | 186 | this.customPi = stage.elementModel.pi; |
176 | this.displayCustomProperties(stage, stage.elementModel.pi); | 187 | this.displayCustomProperties(stage, stage.elementModel.pi); |
177 | } | 188 | } |
@@ -237,6 +248,17 @@ exports.Content = Montage.create(Component, { | |||
237 | 248 | ||
238 | // Custom Section | 249 | // Custom Section |
239 | if(this.customPi !== el.elementModel.pi) { | 250 | if(this.customPi !== el.elementModel.pi) { |
251 | // We need to unregister color chips from the previous selection from the Color Model | ||
252 | var len = this.customSections.length; | ||
253 | for(var n = 0, controls; n < len; n++) { | ||
254 | controls = this.customSections[n].content.controls; | ||
255 | if(controls["colorSelect"]) { | ||
256 | controls["colorSelect"].destroy(); | ||
257 | } else if(controls["stageBackground"]) { | ||
258 | controls["stageBackground"].destroy(); | ||
259 | } | ||
260 | } | ||
261 | |||
240 | this.customPi = el.elementModel.pi; | 262 | this.customPi = el.elementModel.pi; |
241 | this.displayCustomProperties(el, el.elementModel.pi); | 263 | this.displayCustomProperties(el, el.elementModel.pi); |
242 | } | 264 | } |
diff --git a/js/panels/properties/sections/custom-rows/color-select.reel/color-select.html b/js/panels/properties/sections/custom-rows/color-select.reel/color-select.html index 9c2588b9..96cc4de7 100755 --- a/js/panels/properties/sections/custom-rows/color-select.reel/color-select.html +++ b/js/panels/properties/sections/custom-rows/color-select.reel/color-select.html | |||
@@ -14,7 +14,9 @@ | |||
14 | "properties" : { | 14 | "properties" : { |
15 | "element" : {"#": "section"}, | 15 | "element" : {"#": "section"}, |
16 | "Stroke" : {"#": "Stroke"}, | 16 | "Stroke" : {"#": "Stroke"}, |
17 | "Fill" : {"#": "Fill"} | 17 | "Fill" : {"#": "Fill"}, |
18 | "strokeChip" : {"@": "colorChip"}, | ||
19 | "fillChip" : {"@": "colorChip2"} | ||
18 | } | 20 | } |
19 | }, | 21 | }, |
20 | 22 | ||
diff --git a/js/panels/properties/sections/custom-rows/color-select.reel/color-select.js b/js/panels/properties/sections/custom-rows/color-select.reel/color-select.js index 60f8efef..3e81ff67 100755 --- a/js/panels/properties/sections/custom-rows/color-select.reel/color-select.js +++ b/js/panels/properties/sections/custom-rows/color-select.reel/color-select.js | |||
@@ -17,6 +17,14 @@ exports.ColorSelect = Montage.create(Component, { | |||
17 | value: null | 17 | value: null |
18 | }, | 18 | }, |
19 | 19 | ||
20 | strokeChip: { | ||
21 | value: null | ||
22 | }, | ||
23 | |||
24 | fillChip: { | ||
25 | value: null | ||
26 | }, | ||
27 | |||
20 | handleChange: { | 28 | handleChange: { |
21 | value: function(e) { | 29 | value: function(e) { |
22 | 30 | ||
@@ -57,6 +65,19 @@ exports.ColorSelect = Montage.create(Component, { | |||
57 | // } | 65 | // } |
58 | 66 | ||
59 | } | 67 | } |
68 | }, | ||
69 | |||
70 | destroy: { | ||
71 | value: function() { | ||
72 | if(this.strokeChip) | ||
73 | { | ||
74 | this.strokeChip.destroy(); | ||
75 | } | ||
76 | if(this.fillChip) | ||
77 | { | ||
78 | this.fillChip.destroy(); | ||
79 | } | ||
80 | } | ||
60 | } | 81 | } |
61 | 82 | ||
62 | }); \ No newline at end of file | 83 | }); \ No newline at end of file |
diff --git a/js/panels/properties/sections/custom.reel/custom.js b/js/panels/properties/sections/custom.reel/custom.js index a2b9b9fa..a537d323 100755 --- a/js/panels/properties/sections/custom.reel/custom.js +++ b/js/panels/properties/sections/custom.reel/custom.js | |||
@@ -59,6 +59,8 @@ exports.CustomSection = Montage.create(Component, { | |||
59 | if(obj1.visible === false) tmpRow.colorVisible = obj1.visible; | 59 | if(obj1.visible === false) tmpRow.colorVisible = obj1.visible; |
60 | if(obj2.visible === false) tmpRow.color2Visible = obj2.visible; | 60 | if(obj2.visible === false) tmpRow.color2Visible = obj2.visible; |
61 | 61 | ||
62 | // TODO - Hack for now to reference the color select object to unregister color chips | ||
63 | this.controls["colorSelect"] = tmpRow; | ||
62 | } | 64 | } |
63 | else | 65 | else |
64 | { | 66 | { |
@@ -344,6 +346,9 @@ exports.CustomSection = Montage.create(Component, { | |||
344 | 346 | ||
345 | this.controls[aField.id] = obj; | 347 | this.controls[aField.id] = obj; |
346 | 348 | ||
349 | // TODO - Hack for now to reference the color select object to unregister color chips | ||
350 | this.controls["stageBackground"] = obj; | ||
351 | |||
347 | return obj; | 352 | return obj; |
348 | } | 353 | } |
349 | } | 354 | } |