From: David ‘Bombe’ Roden Date: Thu, 14 Apr 2011 19:04:02 +0000 (+0200) Subject: Fix Sone marking. X-Git-Tag: 0.6.2^2~15 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=701e2dedb4d32876e6bfd0761edb4603889d8661;p=Sone.git Fix Sone marking. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index c339f65..b6987c3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -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)}); } } }