Skip to content

Commit

Permalink
Fix date-marker not being removed on loading new messages
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarizedIons committed May 3, 2017
1 parent 5eb5b99 commit f7025de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/js/lounge.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,9 @@ $(function() {
// Remove the date-change marker we put at the top, because it may
// not actually be a date change now
var children = $(chan).children();
if (children.eq(0).hasClass("date-marker")) { // Check top most child
if (children.eq(0).hasClass("date-marker-container")) { // Check top most child
children.eq(0).remove();
} else if (children.eq(0).hasClass("unread-marker") && children.eq(1).hasClass("date-marker")) {
} else if (children.eq(0).hasClass("unread-marker") && children.eq(1).hasClass("date-marker-container")) {
// Otherwise the date-marker would get 'stuck' because of the new-message marker
children.eq(1).remove();
}
Expand Down Expand Up @@ -1364,8 +1364,8 @@ $(function() {

// Remove date-seperators that would otherwise be "stuck" at the top
// of the channel
chan.find(".date-marker").each(function() {
if ($(this).next().hasClass("date-marker")) {
chan.find(".date-marker-container").each(function() {
if ($(this).next().hasClass("date-marker-container")) {
$(this).remove();
}
});
Expand All @@ -1376,7 +1376,7 @@ $(function() {
function clear() {
chat.find(".active")
.find(".show-more").addClass("show").end()
.find(".messages .msg, .date-marker").remove();
.find(".messages .msg, .date-marker-container").remove();
}

function completeNicks(word) {
Expand Down

0 comments on commit f7025de

Please sign in to comment.