Fix focus detection

This commit is contained in:
lilia 2017-04-06 19:58:16 -07:00 committed by Scott Nonnenberg
parent 81a40bb548
commit a381d9c975
No known key found for this signature in database
GPG key ID: A4931C09644C654B

View file

@ -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;