Global: Fix up button

Due to the fact that "document.body.scrollTop" was removed from newer browsers, hovering over this button was not displayed. I replaced this with "window.scrollY" which works in newer browsers. I also localized the text on it.
This commit is contained in:
Maxim Leshchenko 2022-01-30 14:18:39 +02:00
parent 4c841c96a6
commit d87277e7e7
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
4 changed files with 5 additions and 3 deletions

View file

@ -93,7 +93,7 @@
<div class="dimmer"></div> <div class="dimmer"></div>
<div class="toTop"> <div class="toTop">
Вверх {_to_top}
</div> </div>
<div class="layout"> <div class="layout">

View file

@ -1,5 +1,5 @@
window.addEventListener("scroll", function(e) { window.addEventListener("scroll", function(e) {
if(document.body.scrollTop < 100) { if(window.scrollY < 100) {
document.body.classList.toggle("scrolled", false); document.body.classList.toggle("scrolled", false);
} else { } else {
document.body.classList.toggle("scrolled", true); document.body.classList.toggle("scrolled", true);

View file

@ -6,6 +6,7 @@
"home" = "Home"; "home" = "Home";
"welcome" = "Welcome"; "welcome" = "Welcome";
"to_top" = "To top";
/* Login */ /* Login */

View file

@ -7,6 +7,7 @@
"home" = "Главная"; "home" = "Главная";
"welcome" = "Добро пожаловать"; "welcome" = "Добро пожаловать";
"to_top" = "Вверх";
/* Login */ /* Login */