diff options
author | Eric Guzman | 2012-02-27 11:13:35 -0800 |
---|---|---|
committer | Eric Guzman | 2012-02-27 11:13:35 -0800 |
commit | 1a6604a50f6cfbbf0cd6f45ab94b63a001d02162 (patch) | |
tree | bbfc75d1be1ff98d22042dbbed4ca93b4a845e0c /js/components/ui/color-chip.reel | |
parent | 9e8cd4448a6d0f809a55c3bdea8b45ed75339794 (diff) | |
parent | 8125c8c6c9431067840d81c46624b6a2dd5eb4a7 (diff) | |
download | ninja-1a6604a50f6cfbbf0cd6f45ab94b63a001d02162.tar.gz |
Merge branch 'refs/heads/master' into CSSPanelUpdates
Diffstat (limited to 'js/components/ui/color-chip.reel')
-rwxr-xr-x | js/components/ui/color-chip.reel/color-chip.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js index e51bdd8a..ed1ac27a 100755 --- a/js/components/ui/color-chip.reel/color-chip.js +++ b/js/components/ui/color-chip.reel/color-chip.js | |||
@@ -29,12 +29,20 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { | |||
29 | value: 20 | 29 | value: 20 |
30 | }, | 30 | }, |
31 | 31 | ||
32 | initialColor: { | 32 | color: { |
33 | value: false | 33 | value: {r:0, g:0, b:0, a:1, css:'rgb(0,0,0)', mode:'rgb'} |
34 | }, | 34 | }, |
35 | 35 | ||
36 | changeDelegate: { | 36 | changeDelegate: { |
37 | value: null | 37 | value: function(event) { |
38 | this.color = event._event.color; | ||
39 | |||
40 | var evt = document.createEvent("CustomEvent"); | ||
41 | evt.initEvent("change", true, true); | ||
42 | evt.type = "change"; | ||
43 | |||
44 | this.dispatchEvent(evt); | ||
45 | } | ||
38 | }, | 46 | }, |
39 | 47 | ||
40 | prepareForDraw: { | 48 | prepareForDraw: { |
@@ -60,10 +68,10 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { | |||
60 | value: function(evt) { | 68 | value: function(evt) { |
61 | if(this.chip) { | 69 | if(this.chip) { |
62 | // This is a single chip - Not related to the color panel -- Set the initial color if found | 70 | // This is a single chip - Not related to the color panel -- Set the initial color if found |
63 | var mode = "rgb", r = 0, g = 0, b = 0, a = 1, css = "rgb(255,0,0)"; | 71 | var mode = "rgb", r = 0, g = 0, b = 0, a = 1, css = "rgb(0,0,0)"; |
64 | 72 | ||
65 | if(this.initialColor) { | 73 | if(this.color) { |
66 | var colorObj = this.application.ninja.colorController.getColorObjFromCss(this.initialColor); | 74 | var colorObj = this.application.ninja.colorController.getColorObjFromCss(this.color.css); |
67 | mode = colorObj.mode; | 75 | mode = colorObj.mode; |
68 | r = colorObj.value.r; | 76 | r = colorObj.value.r; |
69 | g = colorObj.value.g; | 77 | g = colorObj.value.g; |