diff --git a/js/panel_controller.js b/js/panel_controller.js index 88eb4a28667..64eea47f832 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -10,6 +10,14 @@ window.Whisper = window.Whisper || {}; + var inboxFocused = false; + window.addEventListener('blur', function() { + inboxFocused = false; + }); + window.addEventListener('focus', function() { + inboxFocused = true; + clearAttention(); + }); window.isFocused = function() { return inboxFocused; }; @@ -39,7 +47,6 @@ }; /* Inbox window controller */ - var inboxFocused = false; var inboxOpened = false; var inboxWindowId = 'inbox'; var appWindow = null;