summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-20 09:58:31 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-20 09:58:31 +0200
commitd10575dfee1a09c41fe60ece2f6fe78e41d1946d (patch)
tree9616692a62533e76ebdbedcd63ee2e957c60c879
parent63f28fd0657c121541b1beaabc901dccdf26a534 (diff)
luci-base: form.js: only update option default if cfgvalue is null
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/form.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js
index 2f96ef11bb..93e5f6542c 100644
--- a/modules/luci-base/htdocs/luci-static/resources/form.js
+++ b/modules/luci-base/htdocs/luci-static/resources/form.js
@@ -722,6 +722,7 @@ var CBIAbstractValue = CBINode.extend({
return;
var config_name = this.uciconfig || this.section.uciconfig || this.map.config,
+ cfgvalue = L.toArray(this.cfgvalue(section_id))[0],
default_defval = null, satisified_defval = null;
for (var value in this.defaults) {
@@ -739,7 +740,7 @@ var CBIAbstractValue = CBINode.extend({
satisified_defval = default_defval;
var node = this.map.findElement('id', this.cbid(section_id));
- if (node && node.getAttribute('data-changed') != 'true' && satisified_defval != null)
+ if (node && node.getAttribute('data-changed') != 'true' && satisified_defval != null && cfgvalue == null)
L.dom.callClassMethod(node, 'setValue', satisified_defval);
this.default = satisified_defval;