mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 04:23:13 +00:00
Change history button text while loading
This commit is contained in:
parent
40c129dbb7
commit
6b00cdeba9
3 changed files with 9 additions and 5 deletions
|
@ -708,7 +708,11 @@ $(function() {
|
|||
var self = $(this);
|
||||
var lastMessage = self.parent().next(".messages").children(".msg").first();
|
||||
var lastMessageId = parseInt(lastMessage[0].id.replace("msg-", ""), 10);
|
||||
self.prop("disabled", true);
|
||||
|
||||
self
|
||||
.text("Loading older messages…")
|
||||
.prop("disabled", true);
|
||||
|
||||
socket.emit("more", {
|
||||
target: self.data("id"),
|
||||
lastId: lastMessageId
|
||||
|
|
|
@ -58,5 +58,7 @@ socket.on("more", function(data) {
|
|||
lastDate = msgDate;
|
||||
});
|
||||
|
||||
scrollable.find(".show-more-button").prop("disabled", false);
|
||||
scrollable.find(".show-more-button")
|
||||
.text("Show older messages")
|
||||
.prop("disabled", false);
|
||||
});
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
</div>
|
||||
<div class="chat">
|
||||
<div class="show-more {{#equal messages.length 100}}show{{/equal}}">
|
||||
<button class="show-more-button" data-id="{{id}}">
|
||||
Show older messages
|
||||
</button>
|
||||
<button class="show-more-button" data-id="{{id}}">Show older messages</button>
|
||||
</div>
|
||||
<div class="messages"></div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue