Added link to load more chat-messages using new GET_CHAT_MESSAGES

This commit is contained in:
mluto 2013-01-07 17:36:03 +01:00
parent 5592c4b0fe
commit 5f81daed0a
7 changed files with 37 additions and 7 deletions

View file

@ -556,9 +556,16 @@ var pad = {
pad.collabClient.setOnInternalAction(pad.handleCollabAction);
// load initial chat-messages
var chatHead = clientVars.chatHead;
var start = Math.max(chatHead - 100, 0);
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": chatHead});
if(clientVars.chatHead != -1)
{
var chatHead = clientVars.chatHead;
var start = Math.max(chatHead - 100, 0);
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": chatHead});
}
else // there are no messages
{
$("#chatloadmessages").css("display", "none");
}
function postAceInit()
{