Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset the unread marker on channel change #527

Merged
merged 1 commit into from Jul 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion client/js/lounge.js
Expand Up @@ -764,10 +764,14 @@ $(function() {
.find(".chat")
.unsticky();

lastActive
var lastActiveChan = lastActive
.find(".chan.active")
.removeClass("active");

lastActiveChan
.find(".unread-marker")
.appendTo(lastActiveChan.find(".messages"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this work just fine?

lastActive
            .find(".chan.active")
            .removeClass("active")
            .find(".unread-marker")
            .appendTo(lastActiveChan.find(".messages"));

(I haven't tried, of course 😅)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because the active window contains all the channels, so we need to find the specific channel. That was my initial solution before I ended up with a million unread markers in ever channels.


var chan = $(target)
.addClass("active")
.trigger("show");
Expand Down