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)
|
receive: function(data)
|
||||||
{
|
{
|
||||||
id = data.id;
|
setTimeout(function() {
|
||||||
|
id = data.id;
|
||||||
|
|
||||||
// Don't add it if it already exists
|
// Don't add it if it already exists
|
||||||
//
|
if ($("#notice-"+id).length > 0) {
|
||||||
if ($("#notice-"+id).length > 0) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var noticeItem = RealtimeUpdate.makeNoticeItem(data);
|
var noticeItem = RealtimeUpdate.makeNoticeItem(data);
|
||||||
$("#notices_primary .notices").prepend(noticeItem);
|
$("#notices_primary .notices").prepend(noticeItem);
|
||||||
$("#notices_primary .notice:first").css({display:"none"});
|
$("#notices_primary .notice:first").css({display:"none"});
|
||||||
$("#notices_primary .notice:first").fadeIn(1000);
|
$("#notices_primary .notice:first").fadeIn(1000);
|
||||||
NoticeReply();
|
NoticeReply();
|
||||||
|
}, 500);
|
||||||
},
|
},
|
||||||
|
|
||||||
makeNoticeItem: function(data)
|
makeNoticeItem: function(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user