aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements/element-controller.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-01-31 17:30:53 -0800
committerNivesh Rajbhandari2012-01-31 17:30:53 -0800
commitaffafafc4db16e5f918c74dfc919025d4c563cc6 (patch)
treebae583f698d4993c52b31432b598bf4254f59bb0 /js/controllers/elements/element-controller.js
parentff700e7921b8e30b89e963c48888c8296ed16f52 (diff)
downloadninja-affafafc4db16e5f918c74dfc919025d4c563cc6.tar.gz
Updated color code to handle shapes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/controllers/elements/element-controller.js')
-rw-r--r--js/controllers/elements/element-controller.js43
1 files changed, 41 insertions, 2 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index f254220c..8a0735f7 100644
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -83,13 +83,52 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
83 83
84 setColor: { 84 setColor: {
85 value: function(el, color, isFill) { 85 value: function(el, color, isFill) {
86 var mode = color.mode;
86 if(isFill) 87 if(isFill)
87 { 88 {
88 this.application.ninja.stylesController.setElementStyle(el, "background-color", color.color.css); 89 if(mode)
90 {
91 switch (mode) {
92 case 'nocolor':
93 this.setProperty(el, "background-image", "none");
94 this.setProperty(el, "background-color", "none");
95 break;
96 case 'gradient':
97 this.setProperty(el, "background-image", color.color.css);
98 this.setProperty(el, "background-color", "none");
99 break;
100 default:
101 this.setProperty(el, "background-image", "none");
102 this.setProperty(el, "background-color", color.color.css);
103 }
104 }
105 else
106 {
107 this.application.ninja.stylesController.setElementStyle(el, "background-color", color.color.css);
108 }
89 } 109 }
90 else 110 else
91 { 111 {
92 this.application.ninja.stylesController.setElementStyle(el, "border-color", color.color.css); 112 if(mode)
113 {
114 switch (mode) {
115 case 'nocolor':
116 this.setProperty(el, "border-image", "none");
117 this.setProperty(el, "border-color", "none");
118 break;
119 case 'gradient':
120 this.setProperty(el, "border-image", color.color.css);
121 this.setProperty(el, "border-color", "none");
122 break;
123 default:
124 this.setProperty(el, "border-image", "none");
125 this.setProperty(el, "border-color", color.color.css);
126 }
127 }
128 else
129 {
130 this.application.ninja.stylesController.setElementStyle(el, "border-color", color.color.css);
131 }
93 } 132 }
94 } 133 }
95 }, 134 },