diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-07-27 22:17:33 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-07-27 22:33:36 +0200 |
commit | 2d3470b700237f1c71138c085a4f73c7a809d1a0 (patch) | |
tree | a52331429a04a17ff7c36e159ebe3c4568e3ee66 /modules/luci-base/htdocs | |
parent | b949c0262431c74b0a5f0c426d878207f1d2742a (diff) |
luci-base: don't treat .rmempty flag as optional for ListValue widgets
Restore the old CBI behaviour of not automatically rendering empty
selection choices in ListValue select dropdowns when .rmempty is
specified.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/form.js | 2 | ||||
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 58d8f7100c..ef2f18e35a 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -1460,7 +1460,7 @@ var CBIListValue = CBIValue.extend({ id: this.cbid(section_id), size: this.size, sort: this.keylist, - optional: this.rmempty || this.optional, + optional: this.optional, placeholder: this.placeholder, validate: L.bind(this.validate, this, section_id) }); diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 43afc698f6..2ba0b0d1e8 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -243,7 +243,7 @@ var UISelect = UIElement.extend({ 'multiple': this.options.multiple ? '' : null })); - if (this.options.optional) + if (this.options.optional || this.choices.hasOwnProperty('')) frameEl.lastChild.appendChild(E('option', { 'value': '', 'selected': (this.values.length == 0 || this.values[0] == '') ? '' : null |