Move focus listeners to their own file
// FREEBIE
This commit is contained in:
parent
9f47ff9040
commit
83a020cc5e
3 changed files with 18 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue