From: Jo-Philipp Wich Date: Fri, 13 Sep 2019 12:31:00 +0000 (+0200) Subject: luci-base: cbi.js: save filled out but not added dynlist items on apply X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8a2f1c76b5fbc340fe9c4cbef27cca6ba9c83c87;p=oweals%2Fluci.git luci-base: cbi.js: save filled out but not added dynlist items on apply Fixes: #2938 Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 400d25e09..d71a315da 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -1207,6 +1207,11 @@ function cbi_submit(elem, name, value, action) form.appendChild(hidden); } + var dynadd = form.querySelectorAll('input[data-dynlist-add="true"]'); + for (var i = 0; i < dynadd.length; i++) + if (dynadd[i].value != '') + dynadd[i].nextElementSibling.click(); + form.submit(); return true; }