mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-20 18:01:36 -04:00
fix: update to also obey site settings
This commit is contained in:
+17
-10
@@ -39,17 +39,24 @@ if (document.documentElement.getAttribute("data-auto-appearance") === "true") {
|
||||
}
|
||||
|
||||
function add_to_top_elem() {
|
||||
var body = document.body,
|
||||
html = document.documentElement;
|
||||
var body = document.body;
|
||||
var html = document.documentElement;
|
||||
|
||||
const height = Math.max(
|
||||
body.scrollHeight,
|
||||
body.offsetHeight,
|
||||
html.clientHeight,
|
||||
html.scrollHeight,
|
||||
html.offsetHeight
|
||||
) - 150;
|
||||
document.getElementById("to-top").hidden = height < window.innerHeight;
|
||||
const height =
|
||||
Math.max(
|
||||
body.scrollHeight,
|
||||
body.offsetHeight,
|
||||
html.clientHeight,
|
||||
html.scrollHeight,
|
||||
html.offsetHeight
|
||||
) - 150;
|
||||
|
||||
const elem = document.getElementById("to-top");
|
||||
if (elem === null || elem === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
elem.hidden = height < window.innerHeight;
|
||||
}
|
||||
|
||||
window.addEventListener("DOMContentLoaded", (event) => {
|
||||
|
||||
Reference in New Issue
Block a user