We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 7405d9df authored by Evan Prodromou's avatar Evan Prodromou

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.
parent 192bc42c
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment