Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
    npro  
 Modern all-safe Rust Network Protocol library supporting h1, h2, h3, ws, wt sans-IO and with socket IO + tls
git clone https://npro.rs/repo/npro
 
root / src / common / c-sqlite3.c
Author[]Andy Green <andy@warmcat.com> 2025-09-21 08:16 UTC
Committer[]Andy Green <andy@warmcat.com> 2025-09-24 03:29 UTC
Tree42c89cec6e7c9aab0b52f055d42c87c6799f2de8   Raw Patch
 
js: update autoscroll
js: update autoscroll
diff --git a/assets/sai.js b/assets/sai.js index 6d72a5d..777c73a 100644 --- a/assets/sai.js +++ b/assets/sai.js @@ -1746,25 +1746,27 @@ function ws_open_sai() if (!redpend) { redpend = 1; setTimeout(function() { - redpend = 0; - locked = document.body.scrollHeight - - document.body.clientHeight <= - document.body.scrollTop + 1; + const rightPane = document.querySelector('.right-pane'); + redpend = 0; + if (rightPane) + locked = rightPane.scrollHeight - + rightPane.clientHeight <= + rightPane.scrollTop + 1; - if (document.getElementById("logs")) { - document.getElementById("logs").innerHTML = logs; + if (document.getElementById("logs")) { + document.getElementById("logs").innerHTML = logs; - if (document.getElementById("dlogsn")) - document.getElementById("dlogsn").innerHTML = lines; - - if (document.getElementById("dlogst")) - document.getElementById("dlogst").innerHTML = times; - } + if (document.getElementById("dlogsn")) + document.getElementById("dlogsn").innerHTML = lines; + + if (document.getElementById("dlogst")) + document.getElementById("dlogst").innerHTML = times; + } - if (locked) - document.body.scrollTop = - document.body.scrollHeight - - document.body.clientHeight; + if (locked && rightPane) + rightPane.scrollTop = + rightPane.scrollHeight - + rightPane.clientHeight; }, 500); }
Page fetched 0s ago, creation time: 11ms (vhost etag hits: 0%, cache hits: 0%)