some more scrolling tweaks
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 28 Jan 2017 18:40:34 +0000 (12:40 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 28 Jan 2017 18:40:34 +0000 (12:40 -0600)
data/web-static/js/mudsync.js

index cf340d5d6b1343ff597584d242b7ecfec47d0ee7..0e7ebe6f1c94abc23f64b582c8f87ea0c06436c3 100644 (file)
@@ -26,8 +26,9 @@ function scrollDown() {
 function withMaybeScroll(thunk) {
     var stream_metabox = document.getElementById("stream-metabox");
     var should_scroll = false;
-    if(stream_metabox.scrollTop === (stream_metabox.scrollHeight
-                                     - stream_metabox.offsetHeight)) {
+    // if within a reasonable threshold, we scroll
+    if((stream_metabox.scrollHeight - stream_metabox.offsetHeight)
+       - stream_metabox.scrollTop <= 50) {
         should_scroll = true;
     }
     thunk();