Bundle web-ui v3.1.0a7

This commit is contained in:
grossmj committed 2026-10-21 15:24:00 +07:00
1 parent c1fdd55cb3
commit 179e7e0d17
58 files changed
+4717 -38446

No files matched your search

@@ -42,6 +42,27 @@ SOFTWARE.
const MENU_CLASS_NAME = "Menu";
const VISIBLE_CLASS_NAME = "-visible";
function positionToolbarMenu(ul) {
if (!ul.closest("#menu_list")) return;
// Measure without the opening animation or a previous edge correction.
ul.style.left = "";
ul.style.right = "";
const viewportWidth = document.documentElement.clientWidth;
let bounds = ul.getBoundingClientRect();
if (bounds.right > viewportWidth && ul.id !== "menu_list") {
ul.style.left = "auto";
ul.style.right = "100%";
bounds = ul.getBoundingClientRect();
}
const shift = Math.max(0, -bounds.left) + Math.min(0, viewportWidth - bounds.right);
if (shift) {
ul.style.left = `${ul.offsetLeft + shift}px`;
ul.style.right = "auto";
}
}
function showMenu() {
const menu = this;
const ul = $("ul", menu)[0];
@@ -61,8 +82,10 @@ SOFTWARE.
}
menu.classList.add(ACTIVE_CLASS_NAME);
ul.classList.add(ANIMATING_CLASS_NAME);
ul.classList.remove(ANIMATING_CLASS_NAME);
ul.classList.add(VISIBLE_CLASS_NAME);
positionToolbarMenu(ul);
ul.classList.add(ANIMATING_CLASS_NAME);
setTimeout(function() {
ul.classList.remove(ANIMATING_CLASS_NAME);
}, 25);