From 4d858234ab8e529143641f56c6871a94a38bacb1 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 19 Jul 2019 11:27:33 -0600 Subject: [PATCH] Etemplate - color widget - use white as an empty value instead of showing black --- api/js/etemplate/et2_widget_color.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_color.js b/api/js/etemplate/et2_widget_color.js index 5fce6968f6..edeeb30dcf 100644 --- a/api/js/etemplate/et2_widget_color.js +++ b/api/js/etemplate/et2_widget_color.js @@ -39,14 +39,23 @@ var et2_color = (function(){ "use strict"; return et2_inputWidget.extend( this.input = this.$node = jQuery(""); this.setDOMNode(this.$node[0]); + this.set_value(this.options.value); }, getValue: function() { - return this.$node.val(); + var value = this.$node.val(); + if(value === '#FFFFFF' || value === '#ffffff') + { + return null; + } + return value; }, set_value: function(color) { - + if(!color) + { + color = '#ffffff'; + } this.$node.val(color); } });}).call(this);