session-desktop/js/focus_listener.js
2018-03-08 16:21:27 -05:00

15 lines
293 B
JavaScript

(function () {
'use strict';
var windowFocused = false;
window.addEventListener('blur', function() {
windowFocused = false;
});
window.addEventListener('focus', function() {
windowFocused = true;
});
window.isFocused = function() {
return windowFocused;
};
})();