The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-ui/client/lib/focusWindow.js

32 lines
505 B

/* globals KonchatNotification */
const focusWindow = new class {
constructor() {
this.debug = false;
this.isFocused = true;
}
blur() {
return this.isFocused = false;
}
focus() {
if (!this.isFocused) {
KonchatNotification.focusWindow();
}
return this.isFocused = true;
}
};
Meteor.startup(function() {
$(window).on('blur', () => {
focusWindow.blur();
});
$(window).on('focus', () => {
focusWindow.focus();
});
});
export { focusWindow };
this.focusWindow = focusWindow;