Commit 21c3322b authored by Jonathon Duerig's avatar Jonathon Duerig

Fix bottom-of-page detection for incremental activity log.

parent 3fc1093a
......@@ -37,11 +37,11 @@
// 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.scrollTop);
var shouldScroll = ((document.body.scrollHeight > document.body.clientHeight) || (document.body.scrollHeight - document.body.scrollTop === document.body.clientHeight));
$('pre').append(_.escape(newText));
if (shouldScroll)
{
document.body.scrollTop = document.body.scrollHeight - document.body.clientHeight;
document.body.scrollTop = 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