luci-base: form.js: allow overriding remove action in Table/GridSections
authorJo-Philipp Wich <jo@mein.io>
Tue, 24 Sep 2019 05:59:04 +0000 (07:59 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 24 Sep 2019 05:59:04 +0000 (07:59 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/form.js

index 07cacb324e583b863925cfa57808051dcbdffaff..372773474fd062129fb31b3a293be431a5924ce7 100644 (file)
@@ -1211,10 +1211,7 @@ var CBITableSection = CBITypedSection.extend({
                                E('button', {
                                        'title': btn_title || _('Delete'),
                                        'class': 'cbi-button cbi-button-remove',
-                                       'click': L.ui.createHandlerFn(this, function(sid, ev) {
-                                               this.map.data.remove(config_name, sid);
-                                               return this.map.save(null, true);
-                                       }, section_id)
+                                       'click': L.ui.createHandlerFn(this, 'handleRemove', section_id)
                                }, [ btn_title || _('Delete') ])
                        );
                }