Etemplate - color widget - use white as an empty value instead of showing black

This commit is contained in:
nathangray 2019-07-19 11:27:33 -06:00
parent 5f4045d6b9
commit 4d858234ab

View File

@ -39,14 +39,23 @@ var et2_color = (function(){ "use strict"; return et2_inputWidget.extend(
this.input = this.$node = jQuery("<input type='color' class='et2_color'/>"); this.input = this.$node = jQuery("<input type='color' class='et2_color'/>");
this.setDOMNode(this.$node[0]); this.setDOMNode(this.$node[0]);
this.set_value(this.options.value);
}, },
getValue: function() { getValue: function() {
return this.$node.val(); var value = this.$node.val();
if(value === '#FFFFFF' || value === '#ffffff')
{
return null;
}
return value;
}, },
set_value: function(color) { set_value: function(color) {
if(!color)
{
color = '#ffffff';
}
this.$node.val(color); this.$node.val(color);
} }
});}).call(this); });}).call(this);