Skip to content

Commit

Permalink
Renamed domElem() as mount()
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Mar 17, 2024
1 parent 39fe979 commit 46890e3
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/rav-moves-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ const gameActionsDropdown = new GameActionsDropdown(
}
);

ravMovesTable.domElem();
ravMovesTable.mount();
2 changes: 1 addition & 1 deletion examples/san-moves-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ sanMovesTable.props = {
fen: fen
};

sanMovesTable.domElem();
sanMovesTable.mount();
2 changes: 1 addition & 1 deletion examples/timer-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ const timerTable = new TimerTable(
);

setInterval(() => {
timerTable.count().domElem();
timerTable.count().mount();
}, 1000);
6 changes: 3 additions & 3 deletions src/AbstractComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class AbstractComponent {
this._el = el;
this._props = props;

this.domElem();
this.mount();
}

get props() {
Expand All @@ -17,7 +17,7 @@ export default class AbstractComponent {
this._props = props;
}

domElem() {
throw new Error("The domElem() method is an abstract method.");
mount() {
throw new Error("The mount() method is an abstract method.");
}
}
2 changes: 1 addition & 1 deletion src/GameActionsDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { COLOR } from "https://cdn.jsdelivr.net/npm/[email protected]/src/Ches
import AbstractComponent from '../src/AbstractComponent.js';

export class GameActionsDropdown extends AbstractComponent {
domElem() {
mount() {
this._el.children.item(0).addEventListener('click', (event) => {
event.preventDefault();
this._props.movesTable.props.chessboard.setOrientation(
Expand Down
10 changes: 5 additions & 5 deletions src/HistoryButtons.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import AbstractComponent from '../src/AbstractComponent.js';

export class HistoryButtons extends AbstractComponent {
domElem() {
mount() {
this._el.children.item(0).addEventListener('click', () => {
this.props.movesTable.current = 0;
this.props.movesTable.props.chessboard.setPosition(
this.props.movesTable.props.fen[this.props.movesTable.current], true
);
this.props.movesTable.domElem();
this.props.movesTable.mount();
});

this._el.children.item(1).addEventListener('click', () => {
Expand All @@ -16,7 +16,7 @@ export class HistoryButtons extends AbstractComponent {
this.props.movesTable.props.chessboard.setPosition(
this.props.movesTable.props.fen[this.props.movesTable.current], true
);
this.props.movesTable.domElem();
this.props.movesTable.mount();
}
});

Expand All @@ -26,7 +26,7 @@ export class HistoryButtons extends AbstractComponent {
this.props.movesTable.props.chessboard.setPosition(
this.props.movesTable.props.fen[this.props.movesTable.current], true
);
this.props.movesTable.domElem();
this.props.movesTable.mount();
}
});

Expand All @@ -35,7 +35,7 @@ export class HistoryButtons extends AbstractComponent {
this.props.movesTable.props.chessboard.setPosition(
this.props.movesTable.props.fen[this.props.movesTable.current], true
);
this.props.movesTable.domElem();
this.props.movesTable.mount();
});
}
}
2 changes: 1 addition & 1 deletion src/OpeningTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Opening } from '../src/common/Opening.js';
import AbstractComponent from '../src/AbstractComponent.js';

export class OpeningTable extends AbstractComponent {
domElem() {
mount() {
const opening = Opening.byMovetext(this.props.movetext);
this._el.replaceChildren();
if (opening) {
Expand Down
2 changes: 1 addition & 1 deletion src/RavMovesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class RavMovesTable extends AbstractComponent {
el.classList.add(ACTIVE_MOVE);
}

domElem() {
mount() {
this._el.replaceChildren();

const description = Movetext.description(this.props.breakdown[0]);
Expand Down
2 changes: 1 addition & 1 deletion src/SanMovesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class SanMovesTable extends AbstractComponent {
}
}

domElem() {
mount() {
this._el.replaceChildren();

this._moves().forEach(move => {
Expand Down
2 changes: 1 addition & 1 deletion src/TimerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class TimerTable extends AbstractComponent {
return this;
}

domElem() {
mount() {
this._el.replaceChildren();
const tr = document.createElement('tr');
const wTd = document.createElement('td');
Expand Down

0 comments on commit 46890e3

Please sign in to comment.