From f6e03011801111b40727cf0725a20ec9479dad7f Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 22 Oct 2022 18:24:09 +0200 Subject: [PATCH] [Search] Fix for hidden menu in search result --- application/views/interface_assets/footer.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index bc72391f3..4b42e3d4f 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -860,6 +860,37 @@ function getLookupResult() { $(function () { $('[data-toggle="tooltip"]').tooltip() }); + + $(function () { + // hold onto the drop down menu + var dropdownMenu; + + // and when you show it, move it to the body + $(window).on('show.bs.dropdown', function (e) { + + // grab the menu + dropdownMenu = $(e.target).find('.dropdown-menu'); + + // detach it and append it to the body + $('body').append(dropdownMenu.detach()); + + // grab the new offset position + var eOffset = $(e.target).offset(); + + // make sure to place it where it would normally go (this could be improved) + dropdownMenu.css({ + 'display': 'block', + 'top': eOffset.top + $(e.target).outerHeight(), + 'left': eOffset.left + }); + }); + + // and when you hide it, reattach the drop down, and hide it normally + $(window).on('hide.bs.dropdown', function (e) { + $(e.target).append(dropdownMenu.detach()); + dropdownMenu.hide(); + }); + })();