Fix Sone marking.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Apr 2011 19:04:02 +0000 (21:04 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Apr 2011 19:04:02 +0000 (21:04 +0200)
src/main/resources/static/javascript/sone.js

index c339f65..b6987c3 100644 (file)
@@ -1280,11 +1280,10 @@ function loadNewReply(replyId, soneId, postId, postSoneId) {
  *            request
  */
 function markSoneAsKnown(soneElement, skipRequest) {
-       if ($(".new", soneElement).length > 0) {
-               if ((typeof skipRequest != "undefined") && !skipRequest) {
-                       $.getJSON("maskAsKnown.ajax", {"formPassword": getFormPassword(), "type": "sone", "id": getSoneId(soneElement)}, function(data, textStatus) {
-                               $(soneElement).removeClass("new");
-                       });
+       if ($(soneElement).is(".new")) {
+               $(soneElement).removeClass("new");
+               if ((typeof skipRequest == "undefined") || !skipRequest) {
+                       $.getJSON("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": "sone", "id": getSoneId(soneElement)});
                }
        }
 }