From 0fd7000d91d4bcb417af27b009b546c7b0f38cc0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 19 Jan 2011 19:11:40 +0100 Subject: [PATCH] =?utf8?q?Ajaxify=20notifications=20and=20the=20=E2=80=9Cm?= =?utf8?q?ark=20as=20read=E2=80=9D=20button.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/javascript/sone.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index e084d87..5922717 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -677,7 +677,7 @@ function ajaxifyReply(replyElement) { * jQuery object representing the notification. */ function ajaxifyNotification(notification) { - notification.find("form.dismiss").submit(function() { + notification.find("form").submit(function() { return false; }); notification.find("input[name=returnPage]").val($.url.attr("relative")); @@ -685,6 +685,9 @@ function ajaxifyNotification(notification) { notification.find(".short-text").removeClass("hidden"); notification.find(".text").addClass("hidden"); } + notification.find("form.mark-as-read button").click(function() { + $.getJSON("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": $(":input[name=type]", this.form).val(), "id": $(":input[name=id]", this.form).val()}); + }); notification.find("form.dismiss button").click(function() { $.getJSON("dismissNotification.ajax", { "formPassword" : getFormPassword(), "notification" : notification.attr("id") }, function(data, textStatus) { /* dismiss in case of error, too. */ -- 2.7.4