mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
converted load-more-link to button, added loading-gif, fixed typo
This commit is contained in:
parent
825b258d99
commit
bc05f9eb0a
6 changed files with 34 additions and 12 deletions
|
@ -115,7 +115,7 @@ var chat = (function()
|
|||
|
||||
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
|
||||
if(isHistoryAdd)
|
||||
$(html).insertAfter('#chatloadmessages');
|
||||
$(html).insertAfter('#chatloadmessagesbutton');
|
||||
else
|
||||
$("#chattext").append(html);
|
||||
|
||||
|
@ -165,15 +165,16 @@ var chat = (function()
|
|||
// initial messages are loaded in pad.js' _afterHandshake
|
||||
|
||||
$("#chatcounter").text(0);
|
||||
$("#chatloadmessages").click(function()
|
||||
$("#chatloadmessagesbutton").click(function()
|
||||
{
|
||||
var start = Math.max(self.historyPointer - 20, 0);
|
||||
var end = self.historyPointer;
|
||||
|
||||
if(start == end) // nothing to load
|
||||
return;
|
||||
if(start == 0) // reached the top
|
||||
$("#chatloadmessages").css("display", "none");
|
||||
|
||||
$("#chatloadmessagesbutton").css("display", "none");
|
||||
$("#chatloadmessagesball").css("display", "block");
|
||||
|
||||
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
|
||||
self.historyPointer = start;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue