chiark / gitweb /
log scroll to bottom add some debug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 14 Oct 2020 00:36:36 +0000 (01:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 14 Oct 2020 00:36:36 +0000 (01:36 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index 519cb8390b94f200d16b088ee57e2c030f830bc6..ed79894c7e4f47ae0bac75f9da2b6c4e7bdeb020 100644 (file)
@@ -788,9 +788,13 @@ function add_log_message(msg_html: string) {
     // inspired by
     //   https://stackoverflow.com/questions/487073/how-to-check-if-element-is-visible-after-scrolling/21627295#21627295
     // rejected
-    //   https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
-    lastent.getBoundingClientRect()!.bottom >
-    logdiv.getBoundingClientRect()!.bottom;
+      //   https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
+      (() => {
+       let le = lastent.getBoundingClientRect()!.bottom;
+       let ld = logdiv.getBoundingClientRect()!.bottom;
+       console.log("ADD_LOG_MESSAGE bboxes: le, bb", le, ld);
+       return le > ld;
+      })();
 
   console.log('ADD LOG MESSAGE ',in_scrollback, msg_html);
   var nelem = document.createElement('div');