diff options
author | Valerio Virgillito | 2012-05-18 16:35:56 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-18 16:35:56 -0700 |
commit | fdfba499f0b84360b96096fa866a981e96e8756c (patch) | |
tree | 991e4558104f6b7745d1e0675185496a0c01e0bb /js/components/ui | |
parent | 66edf78c7e5df11218ef733686965beab05c7c7d (diff) | |
download | ninja-fdfba499f0b84360b96096fa866a981e96e8756c.tar.gz |
fixing the color chip for the document root
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/components/ui')
-rwxr-xr-x | js/components/ui/color-chip.reel/color-chip.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js index 4e64b2e8..630dcd4b 100755 --- a/js/components/ui/color-chip.reel/color-chip.js +++ b/js/components/ui/color-chip.reel/color-chip.js | |||
@@ -33,6 +33,11 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { | |||
33 | value: {r:0, g:0, b:0, a:1, css:'rgb(0,0,0)', mode:'rgb'} | 33 | value: {r:0, g:0, b:0, a:1, css:'rgb(0,0,0)', mode:'rgb'} |
34 | }, | 34 | }, |
35 | 35 | ||
36 | chipBtn: { | ||
37 | serializable: true, | ||
38 | value: null | ||
39 | }, | ||
40 | |||
36 | changeDelegate: { | 41 | changeDelegate: { |
37 | value: function(event) { | 42 | value: function(event) { |
38 | this.color = event._event.color; | 43 | this.color = event._event.color; |
@@ -60,7 +65,7 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { | |||
60 | this.icon.style.display = "none"; | 65 | this.icon.style.display = "none"; |
61 | } | 66 | } |
62 | 67 | ||
63 | this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: this.offset}; | 68 | this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, nocolor: true, offset: this.offset}; |
64 | this.application.ninja.colorController.addButton(this.mode, this.chipBtn); | 69 | this.application.ninja.colorController.addButton(this.mode, this.chipBtn); |
65 | 70 | ||
66 | } | 71 | } |
@@ -80,9 +85,13 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { | |||
80 | b = colorObj.value.b; | 85 | b = colorObj.value.b; |
81 | a = colorObj.value.a; | 86 | a = colorObj.value.a; |
82 | css = colorObj.css; | 87 | css = colorObj.css; |
88 | this.chipBtn.color(mode, {wasSetByCode: true, type: 'change', color: {r: r, g: g, b: b}, css: css}); | ||
89 | } else { | ||
90 | mode = "nocolor"; | ||
91 | this.chipBtn.color(mode, null); | ||
92 | |||
83 | } | 93 | } |
84 | 94 | ||
85 | this.chipBtn.color(mode, {wasSetByCode: true, type: 'change', color: {r: r, g: g, b: b}, css: css}); | ||
86 | this.chipBtn.addEventListener("change", this, false); | 95 | this.chipBtn.addEventListener("change", this, false); |
87 | } | 96 | } |
88 | } | 97 | } |