Merge pull request #1156 from PolarizedIons/fix-fix-datemarker

Fix fixing the date-marker not being removed when it should be.
This commit is contained in:
Al McKinlay 2017-05-10 10:13:51 +01:00 committed by GitHub
commit 0480275ab9

View File

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