diff --git a/src/style_manager/view/PropertyColorView.js b/src/style_manager/view/PropertyColorView.js index 9af6e0fad..3bd63b0be 100644 --- a/src/style_manager/view/PropertyColorView.js +++ b/src/style_manager/view/PropertyColorView.js @@ -7,17 +7,6 @@ define(['backbone','./PropertyView', 'Spectrum', 'text!./../templates/propertyCo template: _.template(propertyTemplate), - /** - * @inheritdoc - * */ - valueChanged: function(){ - PropertyView.prototype.valueChanged.apply(this, arguments); - if(this.$colorPicker){ - var v = this.model.get('value'); - this.$colorPicker.spectrum("set", v).css('background-color', v); - } - }, - /** @inheritdoc */ renderInput: function() { if(!this.$input){ @@ -52,8 +41,11 @@ define(['backbone','./PropertyView', 'Spectrum', 'text!./../templates/propertyCo PropertyView.prototype.setValue.apply(this, arguments); var v = this.model.get('value') || this.defaultValue; v = value || v; - if(this.$colorPicker) - this.$colorPicker.spectrum("set", v).css('background-color',v); + if(this.$colorPicker){ + v = v === 'none' ? '#fff' : v; + this.$colorPicker.spectrum("set", v); + this.$colorPicker.get(0).style.backgroundColor = v; + } }, }); diff --git a/test/specs/style_manager/view/PropertyColorView.js b/test/specs/style_manager/view/PropertyColorView.js index f9a1dd804..dcadbc045 100644 --- a/test/specs/style_manager/view/PropertyColorView.js +++ b/test/specs/style_manager/view/PropertyColorView.js @@ -18,6 +18,7 @@ define([path + 'PropertyColorView', 'StyleManager/model/Property', 'DomComponent var defValue = 'test2value'; before(function () { + $.fn.spectrum = function(){}; $fixtures = $("#fixtures"); $fixture = $('
'); });