From 4c535f3eb43be59930fc85e20659fff62de944a6 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Tue, 24 May 2011 20:38:19 -0700 Subject: [PATCH] hackity hack to fix notifciation page decrementing --- public/javascripts/widgets/notifications.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/javascripts/widgets/notifications.js b/public/javascripts/widgets/notifications.js index 70bf9136b..98fef3bb9 100644 --- a/public/javascripts/widgets/notifications.js +++ b/public/javascripts/widgets/notifications.js @@ -7,7 +7,9 @@ var Notifications = function() { this.start = function() { var self = this; - this.badge = $("#notification_badge .badge_count, .notification_count"); + this.badge = $("#notification_badge .badge_count") + this.index_badge = $(".notification_count"); + this.on_index_page = this.index_badge.length > 0 this.notificationArea = $("#notifications"); this.count = parseInt(this.badge.html()) || 0; @@ -50,9 +52,13 @@ if(this.badge.text() !== "") { this.badge.text(this.count); + if(this.on_index_page) + this.index_badge.text(this.count + " "); if(this.count === 0) { this.badge.addClass("hidden"); + if(this.on_index_page) + this.index_badge.removeClass('unread'); } else if(this.count === 1) { this.badge.removeClass("hidden"); @@ -69,4 +75,4 @@ }; Diaspora.widgets.add("notifications", Notifications); -})(); \ No newline at end of file +})();