Skip to content

Commit

Permalink
Minor refactoring and prevent double click
Browse files Browse the repository at this point in the history
  • Loading branch information
bigardone committed Apr 25, 2016
1 parent 183c1fd commit a34c66f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions web/static/js/components/game/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export default class Board extends React.Component {

_renderCell(y, x, value) {
const key = `${y}${x}`;

const onClick = this._handleCellClick(y, x, value);
const onMouseOver = this._handleCellMouseOver(y, x);

const id = this._cellId(key);
const classes = this._cellClasses(value);

Expand All @@ -36,8 +32,9 @@ export default class Board extends React.Component {
id={::this._cellId(key)}
className={classes}
key={key}
onClick={onClick}
onMouseOver={onMouseOver}>{::this._cellValue(value)}</div>
onClick={::this._handleCellClick(y, x, value)}
onDoubleClick={(e) => e.preventDefault()}
onMouseOver={::this._handleCellMouseOver(y, x)}>{::this._cellValue(value)}</div>
);
}

Expand Down

0 comments on commit a34c66f

Please sign in to comment.