aboutsummaryrefslogtreecommitdiff
path: root/src/window-utils.js
diff options
context:
space:
mode:
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 = () => {