Skip to content

Commit

Permalink
Hopefully autoscroll fixed and "New Message!" functional.
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 4, 2010
1 parent 8d8f9ff commit ab13959
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions assets/javascripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,19 @@ function submitMsg()
{
text=$('txtMsg').value;
if (text=="") return;
$('txtMsg').value="";
var myAjax = new Ajax.Request(
'/chat/send_chat',
{method: 'post', parameters: {msg: text}});
$('txtMsg').value="";
new Ajax.Updater('chatMessages', '/chat/receive_chat',
{ method: 'post',
onSuccess: function(){
scrollChatNewest();
justSubmittedMessage=2;
}
});
{method: 'post', parameters: {msg: text},
onSuccess: function(){
new Ajax.Updater('chatMessages', '/chat/receive_chat',
{ method: 'post',
onSuccess: function(){
scrollChatNewest();
justSubmittedMessage=2;
}
});
}});
}
var preContent='0';
function refreshChat()
Expand Down

0 comments on commit ab13959

Please sign in to comment.