mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Merged with main
This commit is contained in:
commit
4b82169fbf
74 changed files with 2018 additions and 1299 deletions
|
|
@ -113,13 +113,24 @@ 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();
|
||||
|
||||
// On macOS with a single-button mouse (e.g. a laptop trackpad),
|
||||
// right-click is triggered with ctrl+click, which triggers both a
|
||||
// `contextmenu` event and a regular click event. We need to stop
|
||||
// event propagation to prevent the click event from triggering the
|
||||
// `selectMove` function and undoing the change we just made.
|
||||
event.stopPropagation();
|
||||
|
||||
// Having stopped propagation, we're no longer subject to Foundry's
|
||||
// default `contextmenu` handler, so we also have to prevent the
|
||||
// default behaviour to prevent a context menu from appearing.
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
static async takeDowntime() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue