[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Admin dropdown menu being cut off near viewport bottom

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6994847a962e2_3b1868485213@gitlab-sidekiq-low-urgency-cpu-bound-v2-59ddc7cd9c-szqdb.mail>

luci pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
c6e10136 by Yves Ngalamulume at 2026-02-17T14:58:00+00:00
[BP][FIX] Admin dropdown menu being cut off near viewport bottom
---
* [FIX] Admin dropdown menu being cut off near viewport bottom

* [FIX] Admin dropdown menu being cut off near viewport bottom
---
* Fix dropdown orientation logic and formatting

* Fix dropdown orientation for mod-menubottom modules

* Fix dropdown orientation for mod-menubottom modules

* Add comment explaining dropdown max-height value

* [FIX] Admin dropdown menu being cut off near viewport bottom

See merge request tikiwiki/tiki!9489

See merge request tikiwiki/tiki!9586

- - - - -


1 changed file:

- src/js/jquery-tiki/tiki-menu.js


Changes:

=====================================
src/js/jquery-tiki/tiki-menu.js
=====================================
@@ -6,26 +6,34 @@
  * meant only for global function and structure definitions.
  *
  * Dependencies: jQuery
+ * Determine dropdown orientation based on module position
+ * instead of viewport-based heuristics.
+ *
+ * This avoids unreliable layout assumptions and ensures
+ * consistent behavior across themes and screen sizes.
  */
 
 $(function () {
     $(".sm-nav-item, .dropdown, .mega-menu").each(function () {
-        const rect = this.getBoundingClientRect();
-        const position = rect.top < window.innerHeight / 2 ? "top" : "bottom";
+        const $parent = $(this);
+        const $menu = $parent.find(".dropdown-menu, ul").first();
+        if (!$menu.length) return;
 
-        let $dropdown = $(this).find(".dropdown-menu");
-        if ($dropdown.length === 0) {
-            $dropdown = $(this).find("ul");
-        }
+        const id = $parent.closest(".card-body").attr("id");
 
-        if ($dropdown.length > 0) {
-            if (position !== "bottom") {
-                $dropdown.removeClass("dropdown-menu-bottom");
-            } else {
-                $dropdown.addClass("dropdown-menu-bottom");
-            }
+        if (id && id.startsWith("mod-menubottom")) {
+            $menu.addClass("dropdown-menu-bottom");
+        } else {
+            $menu.addClass("dropdown-menu-top-t");
         }
     });
+    if ($dropdown.length > 0) {
+        if (position !== "bottom") {
+            $dropdown.removeClass("dropdown-menu-bottom");
+        } else {
+            $dropdown.addClass("dropdown-menu-bottom");
+        }
+    }
 });
 
 /* Mobile dropdown positioning */



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c6e10136a6ebaf654a85ebefd351f4ba45679b74

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c6e10136a6ebaf654a85ebefd351f4ba45679b74
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.