From 95789c708a5c886410e860e72c7fca0c7f21cb17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 25 Nov 2010 15:50:26 +0100 Subject: [PATCH] =?utf8?q?Create=20new=20scopes=20to=20not=20lose=20the=20?= =?utf8?q?element=20we=E2=80=99re=20unmarking.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/javascript/sone.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 32ad683..e7d19e6 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -659,9 +659,11 @@ function markPostAsKnown(postElements) { $(postElements).each(function() { postElement = this; if ($(postElement).hasClass("new")) { - $.getJSON("ajax/markPostAsKnown.ajax", {"formPassword": getFormPassword(), "post": getPostId(postElement)}, function(data, textStatus) { - $(postElement).removeClass("new"); - }); + (function(postElement) { + $.getJSON("ajax/markPostAsKnown.ajax", {"formPassword": getFormPassword(), "post": getPostId(postElement)}, function(data, textStatus) { + $(postElement).removeClass("new"); + }); + })(postElement); } }); markReplyAsKnown($(postElements).find(".reply")); @@ -671,9 +673,11 @@ function markReplyAsKnown(replyElements) { $(replyElements).each(function() { replyElement = this; if ($(replyElement).hasClass("new")) { - $.getJSON("ajax/markReplyAsKnown.ajax", {"formPassword": getFormPassword(), "reply": getReplyId(replyElement)}, function(data, textStatus) { - $(replyElement).removeClass("new"); - }); + (function(replyElement) { + $.getJSON("ajax/markReplyAsKnown.ajax", {"formPassword": getFormPassword(), "reply": getReplyId(replyElement)}, function(data, textStatus) { + $(replyElement).removeClass("new"); + }); + })(replyElement); } }); } -- 2.7.4