update multiselects on other group pages with the same logic

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2020-02-16 16:10:14 +00:00
parent b5e77648ad
commit a7a99ea693
2 changed files with 34 additions and 2 deletions

View File

@@ -108,7 +108,23 @@ function initTable() {
// Select assigned groups
sel.val(data.groups);
// Initialize multiselect
sel.multiselect({ includeSelectAllOption: true });
sel.multiselect({
includeSelectAllOption: true,
buttonContainer: '<div id="container' + data.id + '" class="btn-group"/>',
maxHeight: 200,
onDropdownShown: function() {
var el = $("#container" + data.id);
var top = el[0].getBoundingClientRect().top;
var bottom = $(window).height() - top - el.height();
if (bottom < 200) {
el.addClass("dropup");
}
if (bottom > 200) {
el.removeClass("dropup");
}
}
});
sel.on("change", editAdlist);
var button =

View File

@@ -140,7 +140,23 @@ function initTable() {
// Select assigned groups
sel.val(data.groups);
// Initialize multiselect
sel.multiselect({ includeSelectAllOption: true });
sel.multiselect({
includeSelectAllOption: true,
buttonContainer: '<div id="container' + data.id + '" class="btn-group"/>',
maxHeight: 200,
onDropdownShown: function() {
var el = $("#container" + data.id);
var top = el[0].getBoundingClientRect().top;
var bottom = $(window).height() - top - el.height();
if (bottom < 200) {
el.addClass("dropup");
}
if (bottom > 200) {
el.removeClass("dropup");
}
}
});
sel.on("change", editDomain);
var button =