From: Jo-Philipp Wich Date: Wed, 31 Jul 2019 06:00:29 +0000 (+0200) Subject: luci-base: form.js: add modal dialog hook X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=eb9051c307fa8d6f7da233ee9a5ad7fa732bdc0d;p=oweals%2Fluci.git 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 --- diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 82b7695e4..ab0998943 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -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,