Constructor
new BoardView(boardEl)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
boardEl |
HTMLElement | The |
Classes
Methods
_buildDom()
- Description:
(Re)build the grid of span elements.
- Source:
_renderAll()
- Description:
Re-render every cell on the board (called after attach or board swap).
- Source:
_updateCell(cell)
- Description:
Update the span for a single cell.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
cell |
Cell |
attach(board)
- Description:
Attach the view to a board: build DOM elements, subscribe to changes, and render the initial state.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
board |
Board |
detach()
- Description:
Detach from the current board (on board-to-board navigation).
- Source:
moveCursorTo(x, y)
- Description:
Highlight the cell at (x, y) as the cursor location (removes the previous highlight automatically on the next cell update cycle).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | |
y |
number |
rerender()
- Description:
Force a full re-render (e.g. after the outside/inside flag changes).
- Source: