Fix fixing the date-marker not being removed when it should be.

Accidentally copy-pasted more than I should have when I moved the scrollable height calculation code, and I caused the older
messages to be added before doing checks for the date-markers, which would fail.
This commit is contained in:
PolarizedIons 2017-05-09 19:19:02 +02:00
parent 45df995d7f
commit 54a9637ed4

View file

@ -512,7 +512,6 @@ $(function() {
// get the scrollable wrapper around messages
var scrollable = chan.closest(".chat");
var heightOld = chan.height();
chan.prepend(documentFragment).end();
// Remove the date-change marker we put at the top, because it may
// not actually be a date change now
@ -524,6 +523,9 @@ $(function() {
children.eq(1).remove();
}
// Add the older messages
chan.prepend(documentFragment).end();
// restore scroll position
var position = chan.height() - heightOld;
scrollable.scrollTop(position);