diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-07-31 08:00:29 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-08-01 16:48:50 +0200 |
commit | eb9051c307fa8d6f7da233ee9a5ad7fa732bdc0d (patch) | |
tree | 48be0d24b76ed8ab4524cd41d4d54a93815698cb /modules | |
parent | 5e67b8b72be046d8acd703f5f2e5799b153fed6e (diff) |
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>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/form.js | 6 |
1 files changed, 5 insertions, 1 deletions
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, |