diff options
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index f6a964fb10..fd413042f9 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -223,6 +223,9 @@ var UISelect = UIElement.extend({ widget: 'select', orientation: 'horizontal' }, options); + + if (this.choices.hasOwnProperty('')) + this.options.optional = true; }, render: function() { @@ -243,7 +246,7 @@ var UISelect = UIElement.extend({ 'multiple': this.options.multiple ? '' : null })); - if (this.options.optional || this.choices.hasOwnProperty('')) + if (this.options.optional) frameEl.lastChild.appendChild(E('option', { 'value': '', 'selected': (this.values.length == 0 || this.values[0] == '') ? '' : null |