From: David ‘Bombe’ Roden Date: Wed, 26 Jan 2011 09:12:05 +0000 (+0100) Subject: Remove the “new” class from clicked items immediately. X-Git-Tag: 0.4.3^2~2 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=e54ce7155c6df64ab6171eeb445b456a1153f6f7 Remove the “new” class from clicked items immediately. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 22b7eb2..251105a 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -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); } });