luci-base: form.js: pass section_id to Button onclick handler
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
311bcd4b5c
commit
c1aeb300f6
1 changed files with 4 additions and 1 deletions
|
@ -1894,7 +1894,10 @@ var CBIButtonValue = CBIValue.extend({
|
||||||
L.dom.content(outputEl, [
|
L.dom.content(outputEl, [
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'cbi-button cbi-button-%s'.format(this.inputstyle || '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;
|
ev.currentTarget.parentNode.nextElementSibling.value = value;
|
||||||
return this.map.save();
|
return this.map.save();
|
||||||
}, section_id)
|
}, section_id)
|
||||||
|
|
Loading…
Reference in a new issue