diff options
author | Paul Donald <newtwen+github@gmail.com> | 2024-11-25 21:26:35 +0100 |
---|---|---|
committer | Paul Donald <newtwen+github@gmail.com> | 2024-11-25 21:26:35 +0100 |
commit | 7b2d7ba2a5fc438db7fc99e393b0ced5321c3f6a (patch) | |
tree | 2a36f1ac1c0c7b59c9f310d2e67c899670cbd6cb /modules/luci-base/htdocs/luci-static | |
parent | 9a6dc74ab8d121a99737a949519cbf3407416b14 (diff) |
luci-base: uci: fixed reorder bug where missed deletes caused off-by-one
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/uci.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/uci.js b/modules/luci-base/htdocs/luci-static/resources/uci.js index e52c184e51..35110c0227 100644 --- a/modules/luci-base/htdocs/luci-static/resources/uci.js +++ b/modules/luci-base/htdocs/luci-static/resources/uci.js @@ -153,6 +153,7 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ { reorderSections: function() { var v = this.state.values, n = this.state.creates, + d = this.state.deletes, r = this.state.reorder, tasks = []; @@ -166,10 +167,16 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ { for (var c in r) { var o = [ ]; + // skip deletes within re-orders + if (d[c]) + continue; + + // push creates if (n[c]) for (var s in n[c]) o.push(n[c][s]); + // push values for (var s in v[c]) o.push(v[c][s]); |