X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=base_rules.js;h=0b7d6ed8a397851df0fb3b34007942ff8666e716;hp=08e9d1bd0d1a7174577d5c860230359897c13022;hb=126ffc709b84d4919dc2c1726577e59211198a1b;hpb=98d144512e5505f5ef8b702b139ca6ceff92c823 diff --git a/base_rules.js b/base_rules.js index 08e9d1b..0b7d6ed 100644 --- a/base_rules.js +++ b/base_rules.js @@ -117,7 +117,7 @@ export default class ChessRules { } // Some variants reveal moves only after both players played - hideMoves() { + get hideMoves() { return false; } @@ -2631,7 +2631,7 @@ export default class ChessRules { return 0; //nb of targets } - launchAnimation(moves, callback) { + launchAnimation(moves, container, callback) { if (this.hideMoves) { moves.forEach(m => this.play(m)); callback(); @@ -2658,10 +2658,17 @@ export default class ChessRules { alert("New move! Let's go back to game..."); document.getElementById("gameInfos").style.display = "none"; container.style.display = "block"; - setTimeout(() => this.launchAnimation(moves, callback), 700); + setTimeout( + () => this.launchAnimation(moves, container, callback), + 700 + ); + } + else { + setTimeout( + () => this.launchAnimation(moves, container, callback), + delay || 0 + ); } - else - setTimeout(() => this.launchAnimation(moves, callback), delay || 0); }; let container = document.getElementById(this.containerId); if (document.hidden) {