From 54a9637ed49f8ccb41ee135120a5523eaf6a0308 Mon Sep 17 00:00:00 2001 From: PolarizedIons Date: Tue, 9 May 2017 19:19:02 +0200 Subject: [PATCH] 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. --- client/js/lounge.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/js/lounge.js b/client/js/lounge.js index ab5002a4..e2a3cd13 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -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);