mirror of
https://github.com/thelounge/thelounge
synced 2024-11-14 00:07:17 +00:00
Move 'show more' to same event file
This commit is contained in:
parent
17af195994
commit
41b9ffb5e7
2 changed files with 18 additions and 18 deletions
|
@ -479,24 +479,6 @@ $(function() {
|
|||
container.html(templates.user_filtered({matches: result})).show();
|
||||
});
|
||||
|
||||
chat.on("click", ".show-more-button", function() {
|
||||
var self = $(this);
|
||||
var lastMessage = self.parent().next(".messages").children(".msg").first();
|
||||
if (lastMessage.is(".condensed")) {
|
||||
lastMessage = lastMessage.children(".msg").first();
|
||||
}
|
||||
var lastMessageId = parseInt(lastMessage[0].id.replace("msg-", ""), 10);
|
||||
|
||||
self
|
||||
.text("Loading older messages…")
|
||||
.prop("disabled", true);
|
||||
|
||||
socket.emit("more", {
|
||||
target: self.data("id"),
|
||||
lastId: lastMessageId
|
||||
});
|
||||
});
|
||||
|
||||
var forms = $("#sign-in, #connect, #change-password");
|
||||
|
||||
windows.on("show", "#sign-in", function() {
|
||||
|
|
|
@ -54,3 +54,21 @@ socket.on("more", function(data) {
|
|||
.text("Show older messages")
|
||||
.prop("disabled", false);
|
||||
});
|
||||
|
||||
chat.on("click", ".show-more-button", function() {
|
||||
var self = $(this);
|
||||
var lastMessage = self.parent().next(".messages").children(".msg").first();
|
||||
if (lastMessage.is(".condensed")) {
|
||||
lastMessage = lastMessage.children(".msg").first();
|
||||
}
|
||||
var lastMessageId = parseInt(lastMessage[0].id.replace("msg-", ""), 10);
|
||||
|
||||
self
|
||||
.text("Loading older messages…")
|
||||
.prop("disabled", true);
|
||||
|
||||
socket.emit("more", {
|
||||
target: self.data("id"),
|
||||
lastId: lastMessageId
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue