From 8376bece84fe291e8eb4e45ed178b24c762e1d25 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 14 Oct 2020 01:36:36 +0100 Subject: [PATCH] log scroll to bottom add some debug Signed-off-by: Ian Jackson --- templates/script.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index 519cb839..ed79894c 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -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'); -- 2.30.2