From 42beabd1ccb9ce725041a4efcaff95513c9f89b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 25 Nov 2010 20:56:17 +0100 Subject: [PATCH] Store whether we are focussed in a flag. --- src/main/resources/static/javascript/sone.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index f195d59..472df5a 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -722,6 +722,8 @@ function createNotification(id, text, dismissable) { // EVERYTHING BELOW HERE IS EXECUTED AFTER LOADING THE PAGE // +var focus = true; + $(document).ready(function() { /* this initializes the status update input field. */ @@ -824,7 +826,10 @@ $(document).ready(function() { /* reset activity counter when the page has focus. */ $(window).focus(function() { + focus = true; resetActivity(); - }); + }).blur(function() { + focus = false; + }) }); -- 2.7.4