Timeout a little incase the notice item from XHR response is

not appended to the page.
This commit is contained in:
Sarven Capadisli 2009-09-30 13:29:37 +00:00
parent d9e7118a33
commit a57783de02
1 changed files with 13 additions and 12 deletions

View File

@ -30,19 +30,20 @@ RealtimeUpdate = {
receive: function(data)
{
id = data.id;
setTimeout(function() {
id = data.id;
// Don't add it if it already exists
//
if ($("#notice-"+id).length > 0) {
return;
}
var noticeItem = RealtimeUpdate.makeNoticeItem(data);
$("#notices_primary .notices").prepend(noticeItem);
$("#notices_primary .notice:first").css({display:"none"});
$("#notices_primary .notice:first").fadeIn(1000);
NoticeReply();
// Don't add it if it already exists
if ($("#notice-"+id).length > 0) {
return;
}
var noticeItem = RealtimeUpdate.makeNoticeItem(data);
$("#notices_primary .notices").prepend(noticeItem);
$("#notices_primary .notice:first").css({display:"none"});
$("#notices_primary .notice:first").fadeIn(1000);
NoticeReply();
}, 500);
},
makeNoticeItem: function(data)