admin: scroll current tab in nav to center

for #456, ensures you can see and press both the next and previous tabs
    even if you can't scroll for some reason.
This commit is contained in:
Harvey Tindall
2025-12-19 13:11:37 +00:00
parent e4e9369d54
commit 2a41c5a393
3 changed files with 47 additions and 8 deletions
+28
View File
@@ -101,6 +101,34 @@ window.availableProfiles = window.availableProfiles || [];
}
})();
// Make the navbar horizontally scrollable by dragging (with mouse)
// doesn't work incredibly well so disabled.
/*[...document.getElementsByClassName("horizontally-scrollable")].forEach((c: HTMLElement) => {
c.classList.add("cursor-pointer");
let down = false;
let startX: number, scrollLeft: number;
c.addEventListener("mousedown", (ev: MouseEvent) => {
console.log("down");
down = true;
c.classList.add("active");
startX = ev.pageX - c.offsetLeft;
scrollLeft = c.scrollLeft;
});
const leave = () => {
console.log("up");
down = false;
c.classList.remove("active");
};
c.addEventListener("mouseleave", leave);
c.addEventListener("mouseup", leave);
c.addEventListener("mousemove", (ev: MouseEvent) => {
if (!down) return;
const x = ev.pageX - c.offsetLeft;
const walk = x - startX;
c.scrollLeft = scrollLeft - walk;
});
});*/
var inviteCreator = new createInvite();
var accounts = new accountsList();