From 2edcdd88ffc2f6ff0ea836e4da3e1fd2cb3e856f Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 27 Feb 2012 17:39:26 -0800 Subject: persist undo/redo stack per html document Signed-off-by: Ananya Sen --- js/models/color-model.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/models/color-model.js') 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, { //////////////////////////////////////////////////////// case 'rgb': //Checking for match of previous (RGB) - if (color.r !== this.rgb.r && color.g !== this.rgb.g && color.b !== this.rgb.b) { + if (color && color.r !== this.rgb.r && color.g !== this.rgb.g && color.b !== this.rgb.b) { //Setting value and breaking out of function this.rgb = color; return; @@ -279,7 +279,7 @@ exports.ColorModel = Montage.create(Component, { //////////////////////////////////////////////////////// case 'hsv': //Checking for match of previous (HSV) - if (color.h !== this.hsv.h && color.s !== this.hsv.s && color.v !== this.hsv.v) { + if (color && color.h !== this.hsv.h && color.s !== this.hsv.s && color.v !== this.hsv.v) { //Setting value and breaking out of function this.hsv = color; return; @@ -293,7 +293,7 @@ exports.ColorModel = Montage.create(Component, { //////////////////////////////////////////////////////// case 'hsl': //Checking for match of previous (HSV) - if (color.h !== this.hsl.h && color.s !== this.hsl.s && color.l !== this.hsl.l) { + if (color && color.h !== this.hsl.h && color.s !== this.hsl.s && color.l !== this.hsl.l) { //Setting value and breaking out of function this.hsl = color; return; -- cgit v1.2.3