- Fix typo

- Fix value not re-set after changing select options if value was ''
This commit is contained in:
nathangray 2017-11-17 10:04:29 -07:00
parent cd661ed3ba
commit 6d300827a9

View File

@ -807,7 +807,7 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
if(_options[key]["label"]) _options[key]["label"] = this.egw().lang(_options[key]["label"]); if(_options[key]["label"]) _options[key]["label"] = this.egw().lang(_options[key]["label"]);
if(_options[key]["title"]) _options[key]["title"] = this.egw().lang(_options[key]["title"]); if(_options[key]["title"]) _options[key]["title"] = this.egw().lang(_options[key]["title"]);
} }
else if(_options.lenght>0 || typeof _options === 'object') else if(_options.length>0 || typeof _options === 'object')
{ {
_options[key] = this.egw().lang(_options[key]); _options[key] = this.egw().lang(_options[key]);
} }
@ -872,7 +872,7 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
this.input.trigger("liszt:updated"); this.input.trigger("liszt:updated");
} }
// Sometimes value gets set before options // Sometimes value gets set before options
if(this.value || this.options.empty_label) if(this.value || this.options.empty_label || this.value === '' && this.input.children('[value=""]').length === 1)
{ {
this.set_value(this.value, true); // true = dont try to set_options, to avoid an infinit recursion this.set_value(this.value, true); // true = dont try to set_options, to avoid an infinit recursion
} }