This commit is contained in:
Dapoolp 2025-06-27 18:00:17 +02:00
parent 8423ab6776
commit ddbb6c4fd8
34 changed files with 609 additions and 378 deletions

View file

@ -111,16 +111,18 @@ export default function DHItemMixin(Base) {
}
}
static async editAction(_, button) {
const action = this.document.system.actions[button.dataset.index];
static async editAction(event, button) {
const index = event.target.closest('[data-index]').dataset.index,
action = this.document.system.actions[index];
await new DHActionConfig(action).render(true);
}
static async removeAction(event, button) {
event.stopPropagation();
const action = event.target.closest('[data-index]').dataset.index;
await this.document.update({
'system.actions': this.document.system.actions.filter(
(_, index) => index !== Number.parseInt(button.dataset.index)
(_, index) => index !== Number.parseInt(action)
)
});
}