From 1fe2c74691cafa447a798f325c538f2a0a51f2d0 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 2 Mar 2025 13:13:48 +0200 Subject: [PATCH] dropdown fix --- client/src/ui/app-init.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/client/src/ui/app-init.js b/client/src/ui/app-init.js index 392f28649f..d19029890c 100644 --- a/client/src/ui/app-init.js +++ b/client/src/ui/app-init.js @@ -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'); } }