mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
use page visibility api instead of window.onblur
this lib supports most major browsers
This commit is contained in:
@@ -525,13 +525,13 @@ var socket,
|
||||
|
||||
$('#logout-link').on('click', app.logout);
|
||||
|
||||
$window.blur(function(){
|
||||
app.isFocused = false;
|
||||
});
|
||||
|
||||
$window.focus(function(){
|
||||
app.isFocused = true;
|
||||
app.alternatingTitle('');
|
||||
Visibility.change(function(e, state){
|
||||
if (state === 'visible') {
|
||||
app.isFocused = true;
|
||||
app.alternatingTitle('');
|
||||
} else if (state === 'hidden') {
|
||||
app.isFocused = false;
|
||||
}
|
||||
});
|
||||
|
||||
createHeaderTooltips();
|
||||
|
||||
Reference in New Issue
Block a user