From 90b6b21990df76051a9f639cd7596ec3e93de564 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 1 Dec 2025 23:02:17 -0500 Subject: fix: lint Admin.py after refactor --- Omni/Jr/Web/Components.hs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'Omni/Jr/Web/Components.hs') diff --git a/Omni/Jr/Web/Components.hs b/Omni/Jr/Web/Components.hs index 2f885ce..ac36131 100644 --- a/Omni/Jr/Web/Components.hs +++ b/Omni/Jr/Web/Components.hs @@ -1730,14 +1730,22 @@ timelineScrollScript = ] ( Text.unlines [ "(function() {", - " if (typeof autoscrollEnabled !== 'undefined' && !autoscrollEnabled) return;", - " var log = document.querySelector('.timeline-events');", - " if (log) {", - " var isNearBottom = log.scrollHeight - log.scrollTop - log.clientHeight < 100;", - " if (isNearBottom) {", - " log.scrollTop = log.scrollHeight;", + " function scrollToBottom() {", + " if (typeof autoscrollEnabled !== 'undefined' && !autoscrollEnabled) return;", + " var log = document.querySelector('.timeline-events');", + " if (log) {", + " var isNearBottom = log.scrollHeight - log.scrollTop - log.clientHeight < 100;", + " if (isNearBottom) {", + " log.scrollTop = log.scrollHeight;", + " }", " }", " }", + " scrollToBottom();", + " document.body.addEventListener('htmx:afterSwap', function(e) {", + " if (e.target.closest('.timeline-events') || e.target.classList.contains('timeline-events')) {", + " scrollToBottom();", + " }", + " });", "})();" ] ) -- cgit v1.2.3