X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=b6987c369539217025dce8fba76fee93d07e0392;hb=701e2dedb4d32876e6bfd0761edb4603889d8661;hp=eb8fc74776b77bb98566c1f0d466871c5ec6c1d8;hpb=e7670e864e9e687f9e536f367b8c7da781f0c754;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index eb8fc74..b6987c3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -277,7 +277,7 @@ function getFormPassword() { */ function getSone(soneId) { return $("#sone .sone").filter(function(index) { - return $(".id").text() == soneId; + return $(".id", this).text() == soneId; }); } @@ -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)}); } } }