oakmac / chessboardjs

JavaScript chessboard
https://chessboardjs.com
MIT License
2k stars 406 forks source link

One Play Per Turn #204

Closed compugator2 closed 3 years ago

compugator2 commented 3 years ago

Is there a way to allow only 1 play when the board becomes visible? I am trying to set up a correspondence chess game but cannot have one person playing both sides. White plays then should not be able to do anything further until black plays.

I tried adding this to the end of onDrop but it didn't work:

var childNodes = document.getElementById("board1").getElementsByTagName('*'); for (var node of childNodes) { node.disabled = true; }

oakmac commented 3 years ago

I think Example 4002 might be similar to what you are looking for.

compugator2 commented 3 years ago

Yeah that did it. It didn't seem to work at first until I did a hard refresh on my page to correct for the updated js file. Thanks again.