From 7b2d7ba2a5fc438db7fc99e393b0ced5321c3f6a Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Mon, 25 Nov 2024 21:26:35 +0100 Subject: luci-base: uci: fixed reorder bug where missed deletes caused off-by-one Signed-off-by: Paul Donald --- modules/luci-base/htdocs/luci-static/resources/uci.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/luci-base/htdocs/luci-static') 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]); -- cgit v1.2.3