Remove the “new” class from clicked items immediately.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Jan 2011 09:12:05 +0000 (10:12 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Jan 2011 09:12:05 +0000 (10:12 +0100)
src/main/resources/static/javascript/sone.js

index 22b7eb2..251105a 100644 (file)
@@ -1002,10 +1002,9 @@ function markPostAsKnown(postElements) {
                postElement = this;
                if ($(postElement).hasClass("new")) {
                        (function(postElement) {
-                               $.getJSON("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": "post", "id": getPostId(postElement)}, function(data, textStatus) {
-                                       $(postElement).removeClass("new");
-                                       $(".click-to-show", postElement).removeClass("new");
-                               });
+                               $(postElement).removeClass("new");
+                               $(".click-to-show", postElement).removeClass("new");
+                               $.getJSON("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": "post", "id": getPostId(postElement)});
                        })(postElement);
                }
        });
@@ -1017,9 +1016,8 @@ function markReplyAsKnown(replyElements) {
                replyElement = this;
                if ($(replyElement).hasClass("new")) {
                        (function(replyElement) {
-                               $.getJSON("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": "reply", "id": getReplyId(replyElement)}, function(data, textStatus) {
-                                       $(replyElement).removeClass("new");
-                               });
+                               $(replyElement).removeClass("new");
+                               $.getJSON("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": "reply", "id": getReplyId(replyElement)});
                        })(replyElement);
                }
        });