luci-base: form.js: fix default click action of button options
authorJo-Philipp Wich <jo@mein.io>
Wed, 18 Sep 2019 13:08:19 +0000 (15:08 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 18 Sep 2019 13:08:19 +0000 (15:08 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/form.js

index 7dc63ceb5ab564913cba471375a70549d45a12b3..0fa0008c70078210a62a20ddd36a6348dada20cd 100644 (file)
@@ -1822,7 +1822,7 @@ var CBIButtonValue = CBIValue.extend({
                                E('button', {
                                        'class': 'cbi-button cbi-button-%s'.format(this.inputstyle || 'button'),
                                        'click': L.ui.createHandlerFn(this, this.onclick || function(ev) {
-                                               ev.target.previousElementSibling.value = ev.target.value;
+                                               ev.currentTarget.parentNode.nextElementSibling.value = value;
                                                return this.map.save();
                                        })
                                }, [ btn_title ])