mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 07:36:26 +01:00
Refactor: handle button data attrs the same.
A small refactor to handle `button.dataset.move` (which was assigned to a local const) and `button.dataset.category` (which was accessed directly) in the same way by assigning them both to local consts.
This commit is contained in:
parent
7cbbb3168e
commit
7b820d4c60
1 changed files with 3 additions and 4 deletions
|
|
@ -113,10 +113,9 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
|
|||
|
||||
deselectMove(event) {
|
||||
const button = event.target.closest('.activity-container');
|
||||
const move = button.dataset.move;
|
||||
this.moveData[button.dataset.category].moves[move].selected = this.moveData[button.dataset.category].moves[move]
|
||||
.selected
|
||||
? this.moveData[button.dataset.category].moves[move].selected - 1
|
||||
const { move, category } = button.dataset;
|
||||
this.moveData[category].moves[move].selected = this.moveData[category].moves[move].selected
|
||||
? this.moveData[category].moves[move].selected - 1
|
||||
: 0;
|
||||
|
||||
this.render();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue