Skip to content
Snippets Groups Projects
Commit 070c7706 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

More scrolling fixes for incremental activity log

parent 21c3322b
No related branches found
No related tags found
No related merge requests found
...@@ -37,11 +37,12 @@ ...@@ -37,11 +37,12 @@
// If the user is scrolled to the bottom, make sure they // If the user is scrolled to the bottom, make sure they
// stay scrolled to the bottom after appending. // 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)); $('pre').append(_.escape(newText));
if (shouldScroll) if (shouldScroll)
{ {
document.body.scrollTop = document.body.scrollHeight; window.scroll(window.scrollX, document.body.scrollHeight);
} }
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment