dropdown fix

This commit is contained in:
Yuri Kuznetsov
2025-03-02 13:13:48 +02:00
parent 7b5789e44c
commit 1fe2c74691
+9 -6
View File
@@ -28,10 +28,7 @@
import $ from 'jquery';
/**
* @param {{themeManager: import('theme-manager').default}} options
*/
function uiAppInit(options) {
function uiAppInit() {
const $document = $(document);
const topSpaceHeight = 100;
@@ -67,6 +64,8 @@ function uiAppInit(options) {
const height = $dropdown.outerHeight();
{
const $target = $(target);
const windowHeight = $(window).height();
const top = e.target.getBoundingClientRect().bottom;
@@ -74,10 +73,14 @@ function uiAppInit(options) {
isUp = spaceBelow < 0 && top - topSpaceHeight > height;
if ($target.hasClass('more') || $target.hasClass('tab')) {
return;
}
if (isUp) {
$(target).addClass('dropup');
$target.addClass('dropup');
} else {
$(target).removeClass('dropup');
$target.removeClass('dropup');
}
}