From 070c77066fb95a3e21c10d209dcae8cc6eb72a46 Mon Sep 17 00:00:00 2001
From: Jonathon Duerig <duerig@flux.utah.edu>
Date: Mon, 12 May 2014 12:02:12 -0600
Subject: [PATCH] More scrolling fixes for incremental activity log

---
 www/fetchlogfile.php3 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/www/fetchlogfile.php3 b/www/fetchlogfile.php3
index f3db4c2eb6..7fea1bf29f 100644
--- a/www/fetchlogfile.php3
+++ b/www/fetchlogfile.php3
@@ -37,11 +37,12 @@
 
           // If the user is scrolled to the bottom, make sure they
           // stay scrolled to the bottom after appending.
-          var shouldScroll = ((document.body.scrollHeight > document.body.clientHeight) || (document.body.scrollHeight - document.body.scrollTop === document.body.clientHeight));
+          var shouldScroll = (document.body.scrollHeight - window.scrollY === window.innerHeight);
+	  console.log(document.body.scrollHeight, window.scrollY, window.innerHeight);
           $('pre').append(_.escape(newText));
           if (shouldScroll)
           {
-            document.body.scrollTop = document.body.scrollHeight;
+            window.scroll(window.scrollX, document.body.scrollHeight);
           }
         }
       };
-- 
GitLab