From 8266ac3cf9dd5843daeb1e24b5f90bec450522a9 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 3 Feb 2014 18:20:42 -0500 Subject: [PATCH] Extract notifications.redraw_title(). This sets us up to redraw the window title without having to pass in the unread count, which will be useful for realm name changes. The redraw_title() function is only responsible for rendering stuff, whereas update_title_count() handles the details of caching the count. (imported from commit 67cfb7a273e2a61720ce2bd8d91d73fe1089c813) --- static/js/notifications.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/static/js/notifications.js b/static/js/notifications.js index 87902f7d01..4d0d6dd4ba 100644 --- a/static/js/notifications.js +++ b/static/js/notifications.js @@ -107,7 +107,14 @@ if (window.bridge !== undefined) { window.bridge.updateCount(0); } -exports.update_title_count = function (new_message_count) { +var new_message_count; + +exports.update_title_count = function (count) { + new_message_count = count; + exports.redraw_title(); +}; + +exports.redraw_title = function () { // Update window title and favicon to reflect unread messages in current view var n;