luci-base: luci.js: use createHandlerFn() for page actions
authorJo-Philipp Wich <jo@mein.io>
Mon, 9 Sep 2019 09:25:08 +0000 (11:25 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 10 Sep 2019 13:28:16 +0000 (15:28 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/luci.js

index b4c727a3997d004d85b2ceb81a9938978720554e..80648633dfba9bac2093e5f7ba9ead0185916642 100644 (file)
 
                                if (mc.querySelector('.cbi-map')) {
                                        footer.appendChild(E('div', { 'class': 'cbi-page-actions' }, [
-                                               E('input', {
+                                               E('button', {
                                                        'class': 'cbi-button cbi-button-apply',
-                                                       'type': 'button',
-                                                       'value': _('Save & Apply'),
-                                                       'click': L.bind(this.handleSaveApply, this)
-                                               }), ' ',
-                                               E('input', {
+                                                       'click': L.ui.createHandlerFn(this, 'handleSaveApply')
+                                               }, _('Save & Apply')), ' ',
+                                               E('button', {
                                                        'class': 'cbi-button cbi-button-save',
-                                                       'type': 'submit',
-                                                       'value': _('Save'),
-                                                       'click': L.bind(this.handleSave, this)
-                                               }), ' ',
-                                               E('input', {
+                                                       'click': L.ui.createHandlerFn(this, 'handleSave')
+                                               }, _('Save')), ' ',
+                                               E('button', {
                                                        'class': 'cbi-button cbi-button-reset',
-                                                       'type': 'button',
-                                                       'value': _('Reset'),
-                                                       'click': L.bind(this.handleReset, this)
-                                               })
+                                                       'click': L.ui.createHandlerFn(this, 'handleReset')
+                                               }, _('Reset'))
                                        ]));
                                }