mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-01-07 17:20:19 +01:00
Keep navigation icons visible when switching versions
This commit is contained in:
parent
c6c1b725e9
commit
42191a36ab
13
js/main.js
13
js/main.js
|
|
@ -147,11 +147,15 @@ window.isScrolled = false;
|
|||
let scrollTimeout;
|
||||
|
||||
targetElement.addEventListener("scroll", function() {
|
||||
// Add scrolling class to disable hover effects
|
||||
targetElement.classList.add("scrolling");
|
||||
|
||||
let diff = targetElement.scrollHeight - targetElement.clientHeight;
|
||||
if(Math.abs(targetElement.scrollTop - diff) <= 10 || diff == 0) {
|
||||
let isAtBottomNow = Math.abs(targetElement.scrollTop - diff) <= 10 || diff == 0;
|
||||
|
||||
// Add scrolling class to disable hover effects
|
||||
if (window.isScrolled || !isAtBottomNow) {
|
||||
targetElement.classList.add("scrolling");
|
||||
}
|
||||
|
||||
if(isAtBottomNow) {
|
||||
window.isScrolled = false;
|
||||
} else {
|
||||
window.isScrolled = true;
|
||||
|
|
@ -163,7 +167,6 @@ targetElement.addEventListener("scroll", function() {
|
|||
targetElement.classList.remove("scrolling");
|
||||
doSyntaxHighlighting(); // Only run after scrolling stops
|
||||
}, 150);
|
||||
|
||||
});
|
||||
|
||||
// Create a MutationObserver instance
|
||||
|
|
|
|||
Loading…
Reference in a new issue