mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 22:54:15 +00:00
fix: count only message items for show-more
the `messages` div contains a `date-marker` div and an `unread-marker` div. this causes the `count` variable to be 2 more than the expected value, which makes the show-more button skip two messages when loading history. this change filters the counted elements to fix this issue.
This commit is contained in:
parent
10bafb8b5d
commit
c066f25b17
1 changed files with 1 additions and 1 deletions
|
@ -1189,7 +1189,7 @@ $(function() {
|
|||
|
||||
chat.on("click", ".show-more-button", function() {
|
||||
var self = $(this);
|
||||
var count = self.parent().next(".messages").children().length;
|
||||
var count = self.parent().next(".messages").children(".msg").length;
|
||||
socket.emit("more", {
|
||||
target: self.data("id"),
|
||||
count: count
|
||||
|
|
Loading…
Reference in a new issue