diff options
author | Jose Antonio Marquez | 2012-06-27 11:30:23 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-06-27 11:30:23 -0700 |
commit | 9d7aaf42b4f0bcd3d6aa494bddd64519f1020abd (patch) | |
tree | 192047e6cf57039425ff0a7edd9ec32ce5d65982 /js/panels/color/colorpanelpopup.reel | |
parent | dfa8bfa14de3e60f5fc3797436f39c5b24e40592 (diff) | |
download | ninja-9d7aaf42b4f0bcd3d6aa494bddd64519f1020abd.tar.gz |
Fixing palette reference bug
Diffstat (limited to 'js/panels/color/colorpanelpopup.reel')
-rwxr-xr-x | js/panels/color/colorpanelpopup.reel/colorpanelpopup.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js index 4a868a6d..b8261f26 100755 --- a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js +++ b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js | |||
@@ -128,7 +128,7 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
128 | this.popupSwitchInputTo(this.palettes); | 128 | this.popupSwitchInputTo(this.palettes); |
129 | }.bind(this), true); | 129 | }.bind(this), true); |
130 | // | 130 | // |
131 | this.drawPalette(this.defaultPalette); | 131 | this.drawPalette(this.defaultPalette, this.colorManager); |
132 | } else { | 132 | } else { |
133 | this.btnPalette.style.display = 'none'; | 133 | this.btnPalette.style.display = 'none'; |
134 | } | 134 | } |
@@ -297,7 +297,7 @@ if (this._components.wheel._value) { | |||
297 | //////////////////////////////////////////////////////////////////// | 297 | //////////////////////////////////////////////////////////////////// |
298 | // | 298 | // |
299 | drawPalette: { | 299 | drawPalette: { |
300 | value: function (c) { | 300 | value: function (c, m) { |
301 | var i, button; | 301 | var i, button; |
302 | // | 302 | // |
303 | this.palettes.style.display = 'block'; | 303 | this.palettes.style.display = 'block'; |
@@ -316,27 +316,31 @@ if (this._components.wheel._value) { | |||
316 | color = b._event.srcElement.colorValue; | 316 | color = b._event.srcElement.colorValue; |
317 | color.wasSetByCode = false; | 317 | color.wasSetByCode = false; |
318 | color.type = 'change'; | 318 | color.type = 'change'; |
319 | this.colorManager[b._event.srcElement.colorMode] = color; | 319 | m[b._event.srcElement.colorMode] = color; |
320 | } else { | 320 | } else { |
321 | if (this.colorManager.mode === 'hsl') { | 321 | if (m.mode === 'hsl') { |
322 | rgb = this.colorManager.hexToRgb(b._event.srcElement.colorValue); | 322 | rgb = m.hexToRgb(b._event.srcElement.colorValue); |
323 | if (rgb) { | 323 | if (rgb) { |
324 | color = this.colorManager.rgbToHsl(rgb.r, rgb.g, rgb.b); | 324 | color = m.rgbToHsl(rgb.r, rgb.g, rgb.b); |
325 | color.wasSetByCode = false; | 325 | color.wasSetByCode = false; |
326 | color.type = 'change'; | 326 | color.type = 'change'; |
327 | this.colorManager.hsl = color; | 327 | m.hsl = color; |
328 | } else { | 328 | } else { |
329 | this.colorManager.applyNoColor(false); | 329 | m.applyNoColor(false); |
330 | } | 330 | } |
331 | } else { | 331 | } else { |
332 | color = this.colorManager.hexToRgb(b._event.srcElement.colorValue); | 332 | color = m.hexToRgb(b._event.srcElement.colorValue); |
333 | if (color) { | 333 | if (color) { |
334 | color.wasSetByCode = false; | 334 | color.wasSetByCode = false; |
335 | color.type = 'change'; | 335 | color.type = 'change'; |
336 | this.colorManager.rgb = color; | 336 | m.rgb = color; |
337 | } else { | 337 | } else { |
338 | this.colorManager.applyNoColor(false); | 338 | m.applyNoColor(false); |
339 | } | 339 | } |
340 | //TODO: Remove this is a hack | ||
341 | if (!this.props.panel) { | ||
342 | this.dispatchEvent({type: 'change', wasSetByCode: false, mode: 'hex', value: b._event.srcElement.colorValue}); | ||
343 | } | ||
340 | } | 344 | } |
341 | } | 345 | } |
342 | }.bind(this), true); | 346 | }.bind(this), true); |