From 285d3579bb8f5bfe7a5c9294bf3c75040283276a Mon Sep 17 00:00:00 2001 From: Greg Price Date: Fri, 31 Jan 2014 13:30:20 -0500 Subject: [PATCH] Fix unread comment count tooltip rendering JIRA: FOR-434 --- .../discussion/views/discussion_thread_list_view.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee b/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee index 2dd18717d5..7fa48a9bdd 100644 --- a/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee +++ b/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee @@ -174,12 +174,14 @@ if Backbone? content.addClass("resolved") if thread.get('read') content.addClass("read") - if thread.get('unread_comments_count') > 0 + unreadCount = thread.get('unread_comments_count') + if unreadCount > 0 content.find('.comments-count').addClass("unread").attr( "data-tooltip", interpolate( - ngettext('%(unread_count)s new comment', '%(unread_count)s new comments', {'unread_count': thread.get('unread_comments_count')}), - [thread.get('unread_comments_count')] + ngettext('%(unread_count)s new comment', '%(unread_count)s new comments', unreadCount), + {unread_count: thread.get('unread_comments_count')}, + true ) ) @highlight(content)