aboutsummaryrefslogtreecommitdiff
path: root/js/models/color-model.js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-27 17:39:26 -0800
committerAnanya Sen2012-02-27 17:39:26 -0800
commit2edcdd88ffc2f6ff0ea836e4da3e1fd2cb3e856f (patch)
tree18361c8889884ed9c4eb687182ac42afb0d0f13d /js/models/color-model.js
parent51ed781953bc44bba3c70938aa57b856394cbc88 (diff)
downloadninja-2edcdd88ffc2f6ff0ea836e4da3e1fd2cb3e856f.tar.gz
persist undo/redo stack per html document
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/models/color-model.js')
-rwxr-xr-xjs/models/color-model.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/models/color-model.js b/js/models/color-model.js
index 2c86422f..d3618c3e 100755
--- a/js/models/color-model.js
+++ b/js/models/color-model.js
@@ -265,7 +265,7 @@ exports.ColorModel = Montage.create(Component, {
265 //////////////////////////////////////////////////////// 265 ////////////////////////////////////////////////////////
266 case 'rgb': 266 case 'rgb':
267 //Checking for match of previous (RGB) 267 //Checking for match of previous (RGB)
268 if (color.r !== this.rgb.r && color.g !== this.rgb.g && color.b !== this.rgb.b) { 268 if (color && color.r !== this.rgb.r && color.g !== this.rgb.g && color.b !== this.rgb.b) {
269 //Setting value and breaking out of function 269 //Setting value and breaking out of function
270 this.rgb = color; 270 this.rgb = color;
271 return; 271 return;
@@ -279,7 +279,7 @@ exports.ColorModel = Montage.create(Component, {
279 //////////////////////////////////////////////////////// 279 ////////////////////////////////////////////////////////
280 case 'hsv': 280 case 'hsv':
281 //Checking for match of previous (HSV) 281 //Checking for match of previous (HSV)
282 if (color.h !== this.hsv.h && color.s !== this.hsv.s && color.v !== this.hsv.v) { 282 if (color && color.h !== this.hsv.h && color.s !== this.hsv.s && color.v !== this.hsv.v) {
283 //Setting value and breaking out of function 283 //Setting value and breaking out of function
284 this.hsv = color; 284 this.hsv = color;
285 return; 285 return;
@@ -293,7 +293,7 @@ exports.ColorModel = Montage.create(Component, {
293 //////////////////////////////////////////////////////// 293 ////////////////////////////////////////////////////////
294 case 'hsl': 294 case 'hsl':
295 //Checking for match of previous (HSV) 295 //Checking for match of previous (HSV)
296 if (color.h !== this.hsl.h && color.s !== this.hsl.s && color.l !== this.hsl.l) { 296 if (color && color.h !== this.hsl.h && color.s !== this.hsl.s && color.l !== this.hsl.l) {
297 //Setting value and breaking out of function 297 //Setting value and breaking out of function
298 this.hsl = color; 298 this.hsl = color;
299 return; 299 return;