diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-07-30 13:29:11 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-07-30 13:29:11 +0200 |
commit | 3880c3f22fd5310f6f5c49ac49df89ce39552ce2 (patch) | |
tree | 697883ac6ebb815266474e743d71fa6c866937bd /modules | |
parent | e0771aa49f5cf88352bb8a8979c9d153de822fa3 (diff) |
luci-base: ui.js: save filled out but not added dynlist items on submit
Fixes: #2938
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 2ba0b0d1e8..93e947d01d 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -1327,11 +1327,16 @@ var UIDynamicList = UIElement.extend({ getValue: function() { var items = this.node.querySelectorAll('.item > input[type="hidden"]'), + input = this.node.querySelector('.add-item > input[type="text"]'), v = []; for (var i = 0; i < items.length; i++) v.push(items[i].value); + if (input && input.value != null && input.value.match(/\S/) && + v.filter(function(s) { return s == input.value }).length == 0) + v.push(input.value); + return v; }, |