Commit 070c7706 authored by Jonathon Duerig's avatar Jonathon Duerig

More scrolling fixes for incremental activity log

parent 21c3322b
......@@ -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);
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment