From 7cd97594cf46bb942d07099ffb05fcbceb609e9b Mon Sep 17 00:00:00 2001 From: sostler Date: Thu, 20 May 2010 20:36:33 -0400 Subject: Use function to startTitleUpdater --- static/js/pichat.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'static/js/pichat.js') diff --git a/static/js/pichat.js b/static/js/pichat.js index b212fbd..9b58b5c 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -989,9 +989,6 @@ function onBlur() { HasFocus = false; } -$(window).blur(onBlur); -$(window).focus(onFocus); - function titleUpdater() { if (HasFocus || UnseenMsgCounter == 0 || $('title').text() != OrigTitle) { $('title').text(OrigTitle); @@ -1002,4 +999,8 @@ function titleUpdater() { setTimeout(titleUpdater, 2000); } -setTimeout(titleUpdater, 2000); +function startTitleUpdater() { + $(window).blur(onBlur); + $(window).focus(onFocus); + setTimeout(titleUpdater, 2000); +} -- cgit v1.2.3-70-g09d2