luci-base: form.js: pass section_id to Button onclick handler
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c1aeb300f6
)
This commit is contained in:
parent
405f5e837f
commit
1fdef8cb68
1 changed files with 4 additions and 1 deletions
|
@ -1890,7 +1890,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