Timeout a little incase the notice item from XHR response is
not appended to the page.
This commit is contained in:
parent
d9e7118a33
commit
a57783de02
@ -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;
|
||||
}
|
||||
// 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();
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user