diff options
author | Jose Antonio Marquez | 2012-06-22 23:51:50 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-06-22 23:51:50 -0700 |
commit | 0e7e32cadeb2002ee0c77c224b23aa00859f2183 (patch) | |
tree | 6dec2801cdb405a1924126974d62009d09be70ad /js/panels/color/colorpanelpopup.reel | |
parent | 7396ca7f01ca884564b1dd86a8847d28364f1a96 (diff) | |
download | ninja-0e7e32cadeb2002ee0c77c224b23aa00859f2183.tar.gz |
Added third gradient chip popup
Need to add support for gradient events dispatching from standalone chips. Just need to hook up relays for events besides HSV to bubble up.
Diffstat (limited to 'js/panels/color/colorpanelpopup.reel')
-rwxr-xr-x | js/panels/color/colorpanelpopup.reel/colorpanelpopup.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js index 153817c1..179dc02c 100755 --- a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js +++ b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js | |||
@@ -60,7 +60,7 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
60 | value: function () { | 60 | value: function () { |
61 | // | 61 | // |
62 | this._components = null; | 62 | this._components = null; |
63 | this._components = {wheel: null, combo: null}; | 63 | this._components = {wheel: null, combo: null, gradient: null}; |
64 | } | 64 | } |
65 | }, | 65 | }, |
66 | //////////////////////////////////////////////////////////////////// | 66 | //////////////////////////////////////////////////////////////////// |
@@ -369,27 +369,30 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
369 | drawGradient: { | 369 | drawGradient: { |
370 | value: function (g) { | 370 | value: function (g) { |
371 | //TODO: Remove container, insert in reel | 371 | //TODO: Remove container, insert in reel |
372 | var container = document.createElement('div'), gradient = GradientPicker.create(); | 372 | var container = document.createElement('div'); |
373 | // | ||
374 | this._components.gradient = GradientPicker.create(); | ||
375 | // | ||
373 | this.gradients.appendChild(container); | 376 | this.gradients.appendChild(container); |
374 | //Creating gradient picker from components | 377 | //Creating gradient picker from components |
375 | gradient.element = container; | 378 | this._components.gradient.element = container; |
376 | gradient.hack = this.hack; // TODO: Remove | 379 | this._components.gradient.hack = this.hack; // TODO: Remove |
377 | // | 380 | // |
378 | if (g && g.value && g.value.stops) { | 381 | if (g && g.value && g.value.stops) { |
379 | if (g.value.gradientMode) { | 382 | if (g.value.gradientMode) { |
380 | gradient._mode = g.value.gradientMode; | 383 | this._components.gradient._mode = g.value.gradientMode; |
381 | gradient.value = g.value.stops; | 384 | this._components.gradient.value = g.value.stops; |
382 | } else { | 385 | } else { |
383 | gradient._mode = 'linear'; | 386 | this._components.gradient._mode = 'linear'; |
384 | gradient.value = g.value.stops; | 387 | this._components.gradient.value = g.value.stops; |
385 | } | 388 | } |
386 | } else { | 389 | } else { |
387 | gradient._mode = this.defaultGradient.gradientMode; | 390 | this._components.gradient._mode = this.defaultGradient.gradientMode; |
388 | gradient.value = this.defaultGradient.stops; | 391 | this._components.gradient.value = this.defaultGradient.stops; |
389 | } | 392 | } |
390 | // | 393 | // |
391 | gradient.needsDraw = true; | 394 | this._components.gradient.needsDraw = true; |
392 | gradient.addEventListener('change', function (e){ | 395 | this._components.gradient.addEventListener('change', function (e){ |
393 | // | 396 | // |
394 | if (!e._event.wasSetByCode) { | 397 | if (!e._event.wasSetByCode) { |
395 | this.colorManager.gradient = {value: e._event.gradient, type: 'change', wasSetByCode: false}; | 398 | this.colorManager.gradient = {value: e._event.gradient, type: 'change', wasSetByCode: false}; |