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:
Awal Garg 2017-04-06 00:45:28 +05:30 committed by GitHub
parent 10bafb8b5d
commit c066f25b17

View file

@ -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