Get selectbox _appendOptionElement working with empty_label automatically

This commit is contained in:
Nathan Gray 2011-09-09 15:47:38 +00:00
parent b1b1ab820a
commit a5ea1f78d9

View File

@ -95,6 +95,10 @@ var et2_selectbox = et2_inputWidget.extend({
}, },
_appendOptionElement: function(_value, _label, _title) { _appendOptionElement: function(_value, _label, _title) {
if(_value == "" && (_label == null || _label == "")) {
_label = this.options.empty_label;
}
var option = $j(document.createElement("option")) var option = $j(document.createElement("option"))
.attr("value", _value) .attr("value", _value)
.text(_label); .text(_label);
@ -103,7 +107,6 @@ var et2_selectbox = et2_inputWidget.extend({
{ {
option.attr("title", _title); option.attr("title", _title);
} }
option.appendTo(this.input); option.appendTo(this.input);
}, },