summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-06-13 15:01:00 +0200
committerJo-Philipp Wich <jo@mein.io>2019-07-07 15:36:26 +0200
commitdc2b38cb6f44331b686caa8280dbde0b13c0d45d (patch)
tree0136be3bc0083a480159993898c8486be43d79e7 /modules/luci-base/htdocs
parent1605f29b6f6ebeaf00a27d556bad708bd1d2e836 (diff)
luci-base: {ui,form}.js: allow passing additional CSS classes to modals
Add the ability to pass additional CSS classes to modal dialogs and make use of this facility in form.js to annotate CBI map modals. This can be used later by themes to apply additional CSS rules. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/form.js2
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/ui.js5
2 files changed, 5 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js
index a1bfbdc2b2..8bb0da4a40 100644
--- a/modules/luci-base/htdocs/luci-static/resources/form.js
+++ b/modules/luci-base/htdocs/luci-static/resources/form.js
@@ -1126,7 +1126,7 @@ var CBITableSection = CBITypedSection.extend({
'value': _('Save')
})
])
- ]);
+ ], 'cbi-modal');
}, this)).catch(L.error);
}
});
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js
index c51d651e9e..28d1fa90ae 100644
--- a/modules/luci-base/htdocs/luci-static/resources/ui.js
+++ b/modules/luci-base/htdocs/luci-static/resources/ui.js
@@ -1414,11 +1414,14 @@ return L.Class.extend({
},
/* Modal dialog */
- showModal: function(title, children) {
+ showModal: function(title, children /* , ... */) {
var dlg = modalDiv.firstElementChild;
dlg.setAttribute('class', 'modal');
+ for (var i = 2; i < arguments.length; i++)
+ dlg.classList.add(arguments[i]);
+
L.dom.content(dlg, L.dom.create('h4', {}, title));
L.dom.append(dlg, children);