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);
|
alert(result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
|
li = $("li", xml).get(0);
|
||||||
$("#notices_primary .notice:first").css({display:"none"});
|
id = li.id;
|
||||||
$("#notices_primary .notice:first").fadeIn(2500);
|
if ($("#"+li.id).length == 0) {
|
||||||
NoticeHover();
|
$("#notices_primary .notices").prepend(document._importNode(li, true));
|
||||||
NoticeReply();
|
$("#notices_primary .notice:first").css({display:"none"});
|
||||||
|
$("#notices_primary .notice:first").fadeIn(2500);
|
||||||
|
NoticeHover();
|
||||||
|
NoticeReply();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$("#notice_data-text").val("");
|
$("#notice_data-text").val("");
|
||||||
counter();
|
counter();
|
||||||
|
Loading…
Reference in New Issue
Block a user