summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/uci.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/uci.js b/modules/luci-base/htdocs/luci-static/resources/uci.js
index cbaeb8c080..41e902c5fe 100644
--- a/modules/luci-base/htdocs/luci-static/resources/uci.js
+++ b/modules/luci-base/htdocs/luci-static/resources/uci.js
@@ -489,8 +489,28 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
}
/* requested an entire section */
- if (v[conf])
- return v[conf][sid];
+ if (v[conf]) {
+ /* check whether entire section was deleted */
+ if (d[conf] && d[conf][sid] === true)
+ return null;
+
+ var s = v[conf][sid] || null;
+
+ if (s) {
+ /* merge changes */
+ if (c[conf] && c[conf][sid])
+ for (var opt in c[conf][sid])
+ if (c[conf][sid][opt] != null)
+ s[opt] = c[conf][sid][opt];
+
+ /* merge deletions */
+ if (d[conf] && d[conf][sid])
+ for (var opt in d[conf][sid])
+ delete s[opt];
+ }
+
+ return s;
+ }
return null;
},