Skip to content

Commit

Permalink
Renamed _toggleMove as _activeMove
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Mar 6, 2024
1 parent b4fef86 commit a13acef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SanMovesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class SanMovesTable extends AbstractComponent {
return rows;
}

_toggleMoveInput(el) {
_activeMove(el) {
Array.from(document.querySelectorAll(`.${ACTIVE_MOVE}`)).forEach(el => el.classList.remove(ACTIVE_MOVE));
el.classList.add(ACTIVE_MOVE);
this.props.chessboard.disableMoveInput();
Expand All @@ -69,10 +69,10 @@ export class SanMovesTable extends AbstractComponent {
wTd.addEventListener('click', () => {
this.current = move.wFen;
this.props.chessboard.setPosition(this.props.fen[this.current], true);
this._toggleMoveInput(wTd);
this._activeMove(wTd);
});
if (move.wFen === this.current) {
this._toggleMoveInput(wTd);
this._activeMove(wTd);
}
tr.appendChild(wTd);

Expand All @@ -83,10 +83,10 @@ export class SanMovesTable extends AbstractComponent {
bTd.addEventListener('click', () => {
this.current = move.bFen;
this.props.chessboard.setPosition(this.props.fen[this.current], true);
this._toggleMoveInput(bTd);
this._activeMove(bTd);
});
if (move.bFen === this.current) {
this._toggleMoveInput(bTd);
this._activeMove(bTd);
}
tr.appendChild(bTd);
}
Expand Down

0 comments on commit a13acef

Please sign in to comment.