Don't add a notice if it already exists on the page
Try not to interfere with Ajax posting; don't show something if it's already on the page.
This commit is contained in:
parent
db3b56a2fd
commit
e97223b2ba
|
@ -23,6 +23,14 @@ var updater = function()
|
|||
|
||||
function receive(message)
|
||||
{
|
||||
id = message.data.id;
|
||||
|
||||
// Don't add it if it already exists
|
||||
|
||||
if ($("#notice-"+id).length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var noticeItem = makeNoticeItem(message.data);
|
||||
$("#notices_primary .notices").prepend(noticeItem, true);
|
||||
$("#notices_primary .notice:first").css({display:"none"});
|
||||
|
|
Loading…
Reference in New Issue
Block a user