projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use document.hidden instead of document.hasFocus()
[xogo.git]
/
base_rules.js
diff --git
a/base_rules.js
b/base_rules.js
index
ff698f4
..
acee324
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-2090,9
+2090,9
@@
export default class ChessRules {
else launchAnimation(); //focused user!
};
let boardContainer = document.getElementById("boardContainer");
else launchAnimation(); //focused user!
};
let boardContainer = document.getElementById("boardContainer");
- if (
!document.hasFocus()
) {
-
window.onfocus
= () => {
-
window.onfocus
= undefined;
+ if (
document.hidden
) {
+
document.onvisibilitychange
= () => {
+
document.onvisibilitychange
= undefined;
checkDisplayThenAnimate();
};
}
checkDisplayThenAnimate();
};
}