Anchor scroll to bottom when live previewing reply

This commit is contained in:
Toby Zerner 2015-07-23 14:32:49 +09:30
parent 9dc2616f55
commit 80445f1d70

View File

@ -49,7 +49,12 @@ export default class ReplyComposer extends ComposerBody {
if (content === discussion.replyContent) return;
discussion.replyContent = content;
const anchorToBottom = $(window).scrollTop() + $(window).height() >= $(document).height();
m.redraw();
if (anchorToBottom) {
$(window).scrollTop($(document).height());
}
}, 50);
context.onunload = () => clearInterval(updateInterval);