Skip to content

Commit a34c66f

Browse files
committed
Minor refactoring and prevent double click
1 parent 183c1fd commit a34c66f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

web/static/js/components/game/board.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ export default class Board extends React.Component {
2424

2525
_renderCell(y, x, value) {
2626
const key = `${y}${x}`;
27-
28-
const onClick = this._handleCellClick(y, x, value);
29-
const onMouseOver = this._handleCellMouseOver(y, x);
30-
3127
const id = this._cellId(key);
3228
const classes = this._cellClasses(value);
3329

@@ -36,8 +32,9 @@ export default class Board extends React.Component {
3632
id={::this._cellId(key)}
3733
className={classes}
3834
key={key}
39-
onClick={onClick}
40-
onMouseOver={onMouseOver}>{::this._cellValue(value)}</div>
35+
onClick={::this._handleCellClick(y, x, value)}
36+
onDoubleClick={(e) => e.preventDefault()}
37+
onMouseOver={::this._handleCellMouseOver(y, x)}>{::this._cellValue(value)}</div>
4138
);
4239
}
4340

0 commit comments

Comments
 (0)