Only re-create the widget if the type is actually changed

This commit is contained in:
Nathan Gray 2012-03-22 15:56:16 +00:00
parent e26500aae7
commit 9a5ce92eb4

View File

@ -74,12 +74,15 @@ var et2_date = et2_inputWidget.extend({
}, },
set_type: function(_type) { set_type: function(_type) {
this.type = _type; if(_type != this._type)
this.createInputWidget(); {
this.type = _type;
this.createInputWidget();
}
}, },
set_value: function(_value) { set_value: function(_value) {
var old_value = this.value; var old_value = this.getValue();
if(_value == null || _value == 0) if(_value == null || _value == 0)
{ {
this.value = _value; this.value = _value;
@ -498,7 +501,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
if(_value == 0 || _value == null) if(_value == 0 || _value == null)
{ {
this.span.attr("datetime", ""); this.span.attr("datetime", "").text("");
return; return;
} }