projects
/
xogo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
992d1fe
)
Wait until a player takes focus to animate a move
author
Benjamin Auder
<benjamin.auder@somewhere>
Thu, 11 Nov 2021 20:49:35 +0000
(21:49 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Thu, 11 Nov 2021 20:49:35 +0000
(21:49 +0100)
base_rules.js
patch
|
blob
|
blame
|
history
diff --git
a/base_rules.js
b/base_rules.js
index
ffb9fd6
..
6f11aa1
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-2067,6
+2067,13
@@
export default class ChessRules {
}
playReceivedMove(moves, callback) {
+ if (!document.hasFocus()) {
+ window.onfocus = () => {
+ window.onfocus = undefined;
+ setTimeout(() => this.playReceivedMove(moves, callback), 700);
+ };
+ return;
+ }
const r =
document.getElementById(this.containerId).getBoundingClientRect();
const animateRec = i => {