Skip to content

Commit

Permalink
Enable clear and reset buttons in Range and Cover
Browse files Browse the repository at this point in the history
  • Loading branch information
StasTserk committed Nov 13, 2020
1 parent bbd3ffc commit 4877301
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions module/dialogs/rangeAndCover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ export class RangeAndCoverDialog extends ExtendedTestDialog<RangeAndCoverData> {
html.find('*[data-action="delete-member"]').on('click', (e: JQuery.ClickEvent) => this._deleteMember(e.target));
html.find('*[data-action="toggle-hidden"]').on('click', (e: JQuery.ClickEvent) => this._toggleHidden(e.target));
html.find('.team-grid select, .team-grid input').on('change', (e: JQuery.ChangeEvent) => this.updateCollection(e, this.data.data.teams));
html.find('*[data-action="resetRound"]').on('click', (e) => this._resetRound(e));
html.find('*[data-action="clearAll"]').on('click', (e) => this._clearAll(e));
}
private _clearAll(e: JQuery.ClickEvent): void {
e.preventDefault();
this.data.data.actors = [];
this.data.data.teams = [];
this.data.data.showV1 = this.data.data.showV2 = this.data.data.showV3 = false;
this.persistState(this.data.data);
this.syncData(this.data.data);
this.render();
}
private _resetRound(e: JQuery.ClickEvent): void {
e.preventDefault();
this.data.data.teams.forEach(t => {
t.action1 = t.action2 = t.action3 = "Do Nothing";
});
this.data.data.showV1 = this.data.data.showV2 = this.data.data.showV3 = false;
this.persistState(this.data.data);
this.syncData(this.data.data);
this.render();
}

private _toggleHidden(target: HTMLElement): void {
Expand Down

0 comments on commit 4877301

Please sign in to comment.