Permalink
Browse files

todo done. just highlightOff on same square click

  • Loading branch information...
1 parent ca703f1 commit 7055f9dfe167f68004244a8435c03f1e34f5d62c @pkrumins committed Aug 29, 2010
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/render/viewer.js
View
@@ -148,7 +148,6 @@ function Viewer (board, topside, players, mode, moveMakerF) {
function highlightOnOffFull(sq,x,y) {
highlightOnOff(sq);
- // TODO: game state!!
var moves = MoveGenerator(board, gameState, board.at(x,y), true);
moves.forEach(function (move) {
highlightOnOff(cells[move.x][move.y]);
@@ -161,7 +160,7 @@ function Viewer (board, topside, players, mode, moveMakerF) {
if (srcMove) {
var piece = board.pieceAt(srcMove.x, srcMove.y);
if (srcMove.x == x && srcMove.y == y) { // cancel selected move
- highlightOnOffFull(cell,x,y);
+ highlightOffFull(cell,x,y);
srcMove = null;
return;
}

0 comments on commit 7055f9d

Please sign in to comment.