From eb9051c307fa8d6f7da233ee9a5ad7fa732bdc0d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 31 Jul 2019 08:00:29 +0200 Subject: [PATCH] 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 --- modules/luci-base/htdocs/luci-static/resources/form.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, -- 2.25.1