Move focus listeners to their own file

// FREEBIE
This commit is contained in:
lilia 2017-04-11 16:35:44 -07:00 committed by Scott Nonnenberg
parent 9f47ff9040
commit 83a020cc5e
No known key found for this signature in database
GPG key ID: A4931C09644C654B
3 changed files with 18 additions and 13 deletions

View file

@ -9,24 +9,12 @@
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;
};
window.isOpen = function() {
return inboxOpened;
};
window.drawAttention = function() {
if (inboxOpened && !inboxFocused) {
if (inboxOpened && !isFocused()) {
if (window.keepClear) {
clearInterval(window.keepClear);
delete window.keepClear;