Change history button text while loading
This commit is contained in:
parent
40c129dbb7
commit
6b00cdeba9
@ -708,7 +708,11 @@ $(function() {
|
|||||||
var self = $(this);
|
var self = $(this);
|
||||||
var lastMessage = self.parent().next(".messages").children(".msg").first();
|
var lastMessage = self.parent().next(".messages").children(".msg").first();
|
||||||
var lastMessageId = parseInt(lastMessage[0].id.replace("msg-", ""), 10);
|
var lastMessageId = parseInt(lastMessage[0].id.replace("msg-", ""), 10);
|
||||||
self.prop("disabled", true);
|
|
||||||
|
self
|
||||||
|
.text("Loading older messages…")
|
||||||
|
.prop("disabled", true);
|
||||||
|
|
||||||
socket.emit("more", {
|
socket.emit("more", {
|
||||||
target: self.data("id"),
|
target: self.data("id"),
|
||||||
lastId: lastMessageId
|
lastId: lastMessageId
|
||||||
|
@ -58,5 +58,7 @@ socket.on("more", function(data) {
|
|||||||
lastDate = msgDate;
|
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>
|
||||||
<div class="chat">
|
<div class="chat">
|
||||||
<div class="show-more {{#equal messages.length 100}}show{{/equal}}">
|
<div class="show-more {{#equal messages.length 100}}show{{/equal}}">
|
||||||
<button class="show-more-button" data-id="{{id}}">
|
<button class="show-more-button" data-id="{{id}}">Show older messages</button>
|
||||||
Show older messages
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="messages"></div>
|
<div class="messages"></div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user