diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index 71e0e585..c5a93224 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -120,7 +120,23 @@ function initTable() { // Select assigned groups sel.val(data.groups); // Initialize multiselect - sel.multiselect({ includeSelectAllOption: true }); + sel.multiselect({ + includeSelectAllOption: true, + buttonContainer: '
', + 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", editClient); var button = diff --git a/style/pi-hole.css b/style/pi-hole.css index 1f2a3c35..fa1600f7 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -251,10 +251,4 @@ td.highlight { .pointer { cursor: pointer; -} - -.multiselect-container{ - - max-height:200px; - overflow:auto; - } \ No newline at end of file +} \ No newline at end of file