summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-02-04 22:15:42 +0100
committerJo-Philipp Wich <jo@mein.io>2023-02-04 22:22:53 +0100
commitdd47f3f6742a6d80221b75aa7b6ea27eca2bb535 (patch)
treefcf5ce70629a381caeabb294485a29a6b028a7ee /modules/luci-base/htdocs/luci-static
parent6fe34990265a02dac20f7b352e4039a90fed45ca (diff)
luci-base: form.js: reuse JSONMap data provider in GridSection modals
Reuse the same data provider as the parent JSONMap instance in order to avoid inadvertently mangling the form data when saving the modal edit dialog. Fixes: bb9ede238a ("luci-base: form.js: reuse JSONMap data provider in GridSection modals") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/form.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js
index 4edfc7e135..317b49fdfe 100644
--- a/modules/luci-base/htdocs/luci-static/resources/form.js
+++ b/modules/luci-base/htdocs/luci-static/resources/form.js
@@ -3213,10 +3213,13 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
var m;
- if (parent instanceof CBIJSONMap)
- m = new CBIJSONMap(parent.data.data, null, null);
- else
+ if (parent instanceof CBIJSONMap) {
+ m = new CBIJSONMap(null, null, null);
+ m.data = parent.data;
+ }
+ else {
m = new CBIMap(parent.config, null, null);
+ }
var s = m.section(CBINamedSection, section_id, this.sectiontype);