Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't turn off alert even set showErrors: false in config #129

Open
dpanaben opened this issue Jul 27, 2016 · 0 comments
Open

Can't turn off alert even set showErrors: false in config #129

dpanaben opened this issue Jul 27, 2016 · 0 comments

Comments

@dpanaben
Copy link

I set the showErrors: false in the js, but I still get alert while leaving the chessboard page.

$ ->
  App.chess = new Chess()

  cfg =
    draggable: true
    pieceTheme: "/assets/chesspieces/alpha/{piece}.png"
    showErrors: false
    showNotation: false

    onDragStart: (source, piece, position, orientation) =>
      # make sure the player is allowed to pick up the piece
      return !(App.chess.game_over() ||
               (App.chess.turn() == "w" && piece.search(/^b/) != -1) ||
               (App.chess.turn() == "b" && piece.search(/^w/) != -1) ||
               (orientation == "white" && piece.search(/^b/) != -1) ||
               (orientation == "black" && piece.search(/^w/) != -1))

    onDrop: (source, target) =>
      move = App.chess.move
        from: source
        to: target
        promotion: "q"

      if (move == null)
        # illegal move
        return "snapback"
      else
        App.game.perform("make_move", move)
        App.board.position(App.chess.fen(), false)

  App.board = ChessBoard("chessboard", cfg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant