aboutsummaryrefslogtreecommitdiff
path: root/src/window-utils.js
diff options
context:
space:
mode:
authoramy <[email protected]>2023-02-23 15:20:17 +0000
committeramy <[email protected]>2023-02-23 15:20:17 +0000
commit279ed3d59493d2192df2fd7c797a494c8d713a53 (patch)
tree1a200d1780d006d760730a3d4cca1006e64619f0 /src/window-utils.js
parent1bb422555e58b25cef388b85304a4cb6c58ee92d (diff)
swapped old scrollbars
Diffstat (limited to 'src/window-utils.js')
-rw-r--r--src/window-utils.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/window-utils.js b/src/window-utils.js
index f45dd0f..149b9d0 100644
--- a/src/window-utils.js
+++ b/src/window-utils.js
@@ -21,13 +21,14 @@ let util = {
//target is where the scrollbar will be placed, this element should be
//larger than the root with scrollable overflow
let scrolling = false
- if(!procs[uid])
+ if(undefined==procs[uid])
procs[uid] = {}
target.innerHTML += "<div id='" + uid + "-" + minor_uid + "-content-scrollbar' class='scrollbar'><div id='" + uid + "-" + minor_uid + "-content-scrollbar-point' class='scrollbar-point'></div></div>"
let thi_point = document.getElementById(uid + "-" + minor_uid + "-content-scrollbar-point")
let thi_base = document.getElementById(uid + "-" + minor_uid + "-content-scrollbar")
procs[uid].refresh = ()=>{
- console.log(root.clientHeight / (target.clientHeight / root.clientHeight) / root.clientHeight)
+
+ //console.log(root.clientHeight / (target.clientHeight / root.clientHeight) / root.clientHeight)
thi_point.style.display = "block"
thi_base.style.display = "block"
thi_point.style.height = root.clientHeight / (target.clientHeight / root.clientHeight)
@@ -35,6 +36,10 @@ let util = {
thi_point.style.display = "none"
thi_base.style.display = "none"
}
+
+ if(thi_base.clientHeight<thi_point.offsetTop+thi_point.clientHeight){
+ thi_point.style.top = thi_base.clientHeight-thi_point.clientHeight
+ }
}
console.log(root)
root.onscroll = () => {