forked from GNUsocial/gnu-social
Don't add a node if it's already there
Try not to double-add a node on Ajax submit. Normally not a big deal, but may happen if the CometPlugin (or in the future Strophe or other auto-update plugins) is enabled.
This commit is contained in:
parent
192bc42c91
commit
7405d9dfa6
14
js/util.js
14
js/util.js
@ -188,11 +188,15 @@ $(document).ready(function(){
|
||||
alert(result);
|
||||
}
|
||||
else {
|
||||
$("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
|
||||
$("#notices_primary .notice:first").css({display:"none"});
|
||||
$("#notices_primary .notice:first").fadeIn(2500);
|
||||
NoticeHover();
|
||||
NoticeReply();
|
||||
li = $("li", xml).get(0);
|
||||
id = li.id;
|
||||
if ($("#"+li.id).length == 0) {
|
||||
$("#notices_primary .notices").prepend(document._importNode(li, true));
|
||||
$("#notices_primary .notice:first").css({display:"none"});
|
||||
$("#notices_primary .notice:first").fadeIn(2500);
|
||||
NoticeHover();
|
||||
NoticeReply();
|
||||
}
|
||||
}
|
||||
$("#notice_data-text").val("");
|
||||
counter();
|
||||
|
Loading…
Reference in New Issue
Block a user