diff options
author | Valerio Virgillito | 2012-02-13 14:05:10 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-13 14:05:10 -0800 |
commit | 0d7d6d4d98437a93f31ededa14ca6eb5382c9e58 (patch) | |
tree | 95711517d51e2b100728df267f42390156685c52 /js/panels/properties | |
parent | dcd147265ad0339448ea4466253b03b2899e0cea (diff) | |
download | ninja-0d7d6d4d98437a93f31ededa14ca6eb5382c9e58.tar.gz |
Cleaning up the stage background color chip.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/panels/properties')
-rw-r--r-- | js/panels/properties/content.reel/content.js | 8 | ||||
-rw-r--r-- | js/panels/properties/sections/custom.reel/custom.js | 13 |
2 files changed, 9 insertions, 12 deletions
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index b15f2d71..1ec6d769 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js | |||
@@ -156,10 +156,6 @@ exports.Content = Montage.create(Component, { | |||
156 | var backgroundChip = this.customSections[0].content.controls["background"]; | 156 | var backgroundChip = this.customSections[0].content.controls["background"]; |
157 | backgroundChip.initialColor = ElementsMediator.getProperty(stage, "background"); | 157 | backgroundChip.initialColor = ElementsMediator.getProperty(stage, "background"); |
158 | 158 | ||
159 | // Get stage color | ||
160 | //var backgroundColor = | ||
161 | //console.log(backgroundColor); | ||
162 | |||
163 | /* | 159 | /* |
164 | var customPI = PiData[this.customPi]; | 160 | var customPI = PiData[this.customPi]; |
165 | // Get all the custom section for the custom PI | 161 | // Get all the custom section for the custom PI |
@@ -180,10 +176,6 @@ exports.Content = Montage.create(Component, { | |||
180 | } | 176 | } |
181 | }, | 177 | }, |
182 | 178 | ||
183 | foo: { | ||
184 | value: null | ||
185 | }, | ||
186 | |||
187 | handleFirstDraw: { | 179 | handleFirstDraw: { |
188 | value: function() { | 180 | value: function() { |
189 | this.foo.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); | 181 | this.foo.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); |
diff --git a/js/panels/properties/sections/custom.reel/custom.js b/js/panels/properties/sections/custom.reel/custom.js index 5315defc..a2b9b9fa 100644 --- a/js/panels/properties/sections/custom.reel/custom.js +++ b/js/panels/properties/sections/custom.reel/custom.js | |||
@@ -105,13 +105,14 @@ exports.CustomSection = Montage.create(Component, { | |||
105 | } | 105 | } |
106 | }, | 106 | }, |
107 | 107 | ||
108 | /** | ||
109 | * Color change handler. Hard coding the stage for now since only the stage PI uses this color chip | ||
110 | */ | ||
108 | handleColorChange: { | 111 | handleColorChange: { |
109 | value: function(event) { | 112 | value: function(event) { |
110 | // Change the stage color for now | 113 | // Change the stage color for now |
111 | console.log(this); | 114 | //console.log(this, event); |
112 | console.log(event); | 115 | ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); |
113 | console.log(event._event.color.css); | ||
114 | ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], "background", [event._event.color.css], "Change", "pi", 'foo'); | ||
115 | /* | 116 | /* |
116 | var propEvent = document.createEvent("CustomEvent"); | 117 | var propEvent = document.createEvent("CustomEvent"); |
117 | propEvent.initEvent("propertyChange", true, true); | 118 | propEvent.initEvent("propertyChange", true, true); |
@@ -330,11 +331,15 @@ exports.CustomSection = Montage.create(Component, { | |||
330 | createColorChip: { | 331 | createColorChip: { |
331 | value: function(aField) { | 332 | value: function(aField) { |
332 | var obj = ColorChip.create(); | 333 | var obj = ColorChip.create(); |
334 | |||
333 | obj.chip = true; | 335 | obj.chip = true; |
334 | obj.iconType = "fillIcon"; | 336 | obj.iconType = "fillIcon"; |
335 | obj.mode = "chip"; | 337 | obj.mode = "chip"; |
336 | obj.offset = 0; | 338 | obj.offset = 0; |
337 | 339 | ||
340 | if (aField.id) obj.id = aField.id; | ||
341 | if (aField.prop) obj.prop = aField.prop; | ||
342 | |||
338 | obj.changeDelegate = this.handleColorChange; | 343 | obj.changeDelegate = this.handleColorChange; |
339 | 344 | ||
340 | this.controls[aField.id] = obj; | 345 | this.controls[aField.id] = obj; |