luci-base: form.js: add modal dialog hook

Add a new `addModalOptions()` hook which allows to supply additional
cbi options the modal map before the dialog is rendered.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-07-31 08:00:29 +02:00
parent 5e67b8b72b
commit eb9051c307

View file

@ -1067,6 +1067,10 @@ var CBITableSection = CBITypedSection.extend({
.catch(function() {});
},
addModalOptions: function(modalSection, section_id, ev) {
},
renderMoreOptionsModal: function(section_id, ev) {
var parent = this.map,
title = parent.title,
@ -1111,7 +1115,7 @@ var CBITableSection = CBITypedSection.extend({
}
//ev.target.classList.add('spinning');
m.render().then(L.bind(function(nodes) {
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,