summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-02-12 22:21:29 +0100
committerJo-Philipp Wich <jo@mein.io>2020-02-13 19:26:33 +0100
commitc1aeb300f6976086e48dd90aac1504f38b73cdf9 (patch)
treed25ed0fe57f4940ede68b61dcf5466382be584ff /modules/luci-base/htdocs
parent311bcd4b5cb9f630e41f4fc5e08a6993fddc289a (diff)
luci-base: form.js: pass section_id to Button onclick handler
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/form.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js
index b31dac714..9c59c650a 100644
--- a/modules/luci-base/htdocs/luci-static/resources/form.js
+++ b/modules/luci-base/htdocs/luci-static/resources/form.js
@@ -1894,7 +1894,10 @@ var CBIButtonValue = CBIValue.extend({
L.dom.content(outputEl, [
E('button', {
'class': 'cbi-button cbi-button-%s'.format(this.inputstyle || 'button'),
- 'click': L.ui.createHandlerFn(this, this.onclick || function(ev) {
+ 'click': L.ui.createHandlerFn(this, function(section_id, ev) {
+ if (this.onclick)
+ return this.onclick(ev, section_id);
+
ev.currentTarget.parentNode.nextElementSibling.value = value;
return this.map.save();
}, section_id)