luci-base: uci.js: fix section deletion logic
authorJo-Philipp Wich <jo@mein.io>
Sun, 26 Apr 2020 16:41:19 +0000 (18:41 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sun, 26 Apr 2020 16:45:58 +0000 (18:45 +0200)
commit49c6a810e9a705217f4543099d8188f0f3158f6c
tree6c81ba24e8ee5948ba50ad55a255d512204f7787
parentbaa3bd4aac64984dfbecf8e524cfb31ed485a916
luci-base: uci.js: fix section deletion logic

 - Process deletions before additions or changes, allowing user code to
   remove and recreate a section with the same name.

 - Only record section deletions when the section to be removed actually
   existed in the original config or when it was staged for creation
   earlier. This avoids stray ubus not found exception when saving.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/uci.js