Permalink
Browse files

Store original page title for use when updating page title with unrea…

…d messages in the demo.
  • Loading branch information...
1 parent 91d926e commit 2cd67dd8c2a9ed98381a2212e91d7ad995b8408b @scottgonzalez committed Apr 26, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 demo/web/js/client.js
View
7 demo/web/js/client.js
@@ -1,6 +1,7 @@
(function($) {
-var colors = ["green", "orange", "yellow", "red", "fuschia", "blue"],
+var title = document.title,
+ colors = ["green", "orange", "yellow", "red", "fuschia", "blue"],
channel = nodeChat.connect("/chat"),
scroll = true,
log,
@@ -206,13 +207,13 @@ $(function() {
})
.focus(function() {
focused = true;
- document.title = "node chat";
+ document.title = title;
});
$(channel).bind("msg", function(event, message) {
if (!focused) {
unread++;
- document.title = "(" + unread + ") node chat";
+ document.title = "(" + unread + ") " + title;
}
});
});

0 comments on commit 2cd67dd

Please sign in to comment.