luci-base: form.js: use createHandlerFn() for modal button actions
authorJo-Philipp Wich <jo@mein.io>
Wed, 21 Aug 2019 15:59:58 +0000 (17:59 +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/form.js

index 2d1d6960baae3fd753be0b9f77f3056aff107318..31f6bd9616013f6e5182fea2aae20aa906027259 100644 (file)
@@ -1153,24 +1153,18 @@ var CBITableSection = CBITypedSection.extend({
                        }
                }
 
-               //ev.target.classList.add('spinning');
                Promise.resolve(this.addModalOptions(s, section_id, ev)).then(L.bind(m.render, m)).then(L.bind(function(nodes) {
-                       //ev.target.classList.remove('spinning');
                        L.ui.showModal(title, [
                                nodes,
                                E('div', { 'class': 'right' }, [
-                                       E('input', {
-                                               'type': 'button',
+                                       E('button', {
                                                'class': 'btn',
-                                               'click': L.bind(this.handleModalCancel, this, m),
-                                               'value': _('Dismiss')
-                                       }), ' ',
-                                       E('input', {
-                                               'type': 'button',
+                                               'click': L.ui.createHandlerFn(this, 'handleModalCancel', m)
+                                       }, _('Dismiss')), ' ',
+                                       E('button', {
                                                'class': 'cbi-button cbi-button-positive important',
-                                               'click': L.bind(this.handleModalSave, this, m),
-                                               'value': _('Save')
-                                       })
+                                               'click': L.ui.createHandlerFn(this, 'handleModalSave', m)
+                                       }, _('Save'))
                                ])
                        ], 'cbi-modal');
                }, this)).catch(L.error);