diff options
author | Nivesh Rajbhandari | 2012-02-01 21:14:17 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-02-01 21:14:17 -0800 |
commit | 01efeff045e7196bab37fc60f7030969ad650d6c (patch) | |
tree | cafdccd2b9ff511294cfd2a4ba2dc244b8ebb0d2 /js | |
parent | 830b011d94d728882286d72e129f7405134957c7 (diff) | |
download | ninja-01efeff045e7196bab37fc60f7030969ad650d6c.tar.gz |
Removed border special-casing from PI since the mediator now handles this generically. Updated mediator's set stroke routine to use the setColor routine.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/controllers/elements/element-controller.js | 13 | ||||
-rw-r--r-- | js/panels/properties/content.reel/content.js | 7 | ||||
-rw-r--r-- | js/tools/FillTool.js | 20 |
3 files changed, 20 insertions, 20 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 892ac2f2..9b13e703 100644 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -144,10 +144,6 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, | |||
144 | this.setProperty(el, "background-color", color.color.css); | 144 | this.setProperty(el, "background-color", color.color.css); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | else | ||
148 | { | ||
149 | this.application.ninja.stylesController.setElementStyle(el, "background-color", color.color.css); | ||
150 | } | ||
151 | el.elementModel.fill = color; | 147 | el.elementModel.fill = color; |
152 | } | 148 | } |
153 | else | 149 | else |
@@ -169,10 +165,6 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, | |||
169 | this.setProperty(el, "border-color", color.color.css); | 165 | this.setProperty(el, "border-color", color.color.css); |
170 | } | 166 | } |
171 | } | 167 | } |
172 | else | ||
173 | { | ||
174 | this.application.ninja.stylesController.setElementStyle(el, "border-color", color.color.css); | ||
175 | } | ||
176 | el.elementModel.stroke = color; | 168 | el.elementModel.stroke = color; |
177 | } | 169 | } |
178 | } | 170 | } |
@@ -187,8 +179,9 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, | |||
187 | 179 | ||
188 | setStroke: { | 180 | setStroke: { |
189 | value: function(el, stroke) { | 181 | value: function(el, stroke) { |
190 | var border = stroke.borderWidth + stroke.borderUnits + " " + stroke.borderStyle + " " + stroke.color.color.css; | 182 | this.application.ninja.stylesController.setElementStyle(el, "border-width", stroke.borderWidth + stroke.borderUnits); |
191 | this.application.ninja.stylesController.setElementStyle(el, "border", border); | 183 | this.application.ninja.stylesController.setElementStyle(el, "border-style", stroke.borderStyle); |
184 | this.setColor(el, stroke.color, false); | ||
192 | } | 185 | } |
193 | }, | 186 | }, |
194 | 187 | ||
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 34c38e70..6cb66071 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js | |||
@@ -198,7 +198,6 @@ exports.Content = Montage.create(Component, { | |||
198 | this.application.ninja.colorController.colorModel.input = "fill"; | 198 | this.application.ninja.colorController.colorModel.input = "fill"; |
199 | } | 199 | } |
200 | 200 | ||
201 | debugger; | ||
202 | if(currentValue) | 201 | if(currentValue) |
203 | { | 202 | { |
204 | if(currentValue.mode === "gradient") | 203 | if(currentValue.mode === "gradient") |
@@ -270,12 +269,6 @@ exports.Content = Montage.create(Component, { | |||
270 | 269 | ||
271 | e.units ? newValue = e.value + e.units : newValue = e.value; | 270 | e.units ? newValue = e.value + e.units : newValue = e.value; |
272 | 271 | ||
273 | if(e.prop === "border-width") {// || e.prop === "border-style") { | ||
274 | ElementsMediator.setProperty(this.application.ninja.selectedElements, "border-style", [this.customSections[0].content.controls.borderStyle], "Change", "pi"); | ||
275 | } else if(e.prop === "border-style") { | ||
276 | ElementsMediator.setProperty(this.application.ninja.selectedElements, "border-width", [this.customSections[0].content.controls.borderWidth + "px"], "Change", "pi"); | ||
277 | } | ||
278 | |||
279 | ElementsMediator.setProperty(this.application.ninja.selectedElements, e.prop, [newValue], "Change", "pi"); | 272 | ElementsMediator.setProperty(this.application.ninja.selectedElements, e.prop, [newValue], "Change", "pi"); |
280 | 273 | ||
281 | } | 274 | } |
diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js index 477966da..fabcec69 100644 --- a/js/tools/FillTool.js +++ b/js/tools/FillTool.js | |||
@@ -54,10 +54,24 @@ exports.FillTool = Montage.create(ModifierToolBase, { | |||
54 | value: function(event) { | 54 | value: function(event) { |
55 | this.isDrawing = true; | 55 | this.isDrawing = true; |
56 | 56 | ||
57 | if(this._canColor) | 57 | if(this._canColor && this.application.ninja.selectedElements.length) |
58 | { | 58 | { |
59 | var color = this.application.ninja.colorController.colorToolbar.fill; | 59 | var color = this.application.ninja.colorController.colorToolbar.fill, |
60 | ElementsMediator.setColor(this.application.ninja.selectedElements, color, true, "Change", "fillTool"); | 60 | colorInfo; |
61 | if(color && color.color) | ||
62 | { | ||
63 | colorInfo = { mode:color.colorMode, | ||
64 | color:color.color | ||
65 | }; | ||
66 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, true, "Change", "fillTool"); | ||
67 | } | ||
68 | else | ||
69 | { | ||
70 | colorInfo = { mode:"nocolor", | ||
71 | color:color.color | ||
72 | }; | ||
73 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, true, "Change", "fillTool"); | ||
74 | } | ||
61 | } | 75 | } |
62 | } | 76 | } |
63 | } | 77 | } |