diff --git a/module/apps/PlayerSheet.mjs b/module/apps/PlayerSheet.mjs index f73bbb3..ea17756 100644 --- a/module/apps/PlayerSheet.mjs +++ b/module/apps/PlayerSheet.mjs @@ -248,6 +248,32 @@ export class PlayerSheet extends ], { jQuery: false, fixed: true }, ); + + new ContextMenu.implementation( + this.element, + `fieldset.attribute`, + [ + { + label: _loc(`taf.misc.edit`), + condition: (el) => { + const itemUuid = el.dataset.itemUuid; + const itemExists = itemUuid != null && itemUuid !== ``; + return this.isEditable && itemExists; + }, + onClick: editItemFromElement, + }, + { + label: _loc(`taf.misc.delete`), + condition: (el) => { + const itemUuid = el.dataset.itemUuid; + const itemExists = itemUuid != null && itemUuid !== ``; + return this.isEditable && itemExists; + }, + onClick: deleteItemFromElement, + }, + ], + { jQuery: false, fixed: true }, + ); }; async close() { diff --git a/templates/PlayerSheet/primary-attributes.hbs b/templates/PlayerSheet/primary-attributes.hbs index cd99916..cf4589c 100644 --- a/templates/PlayerSheet/primary-attributes.hbs +++ b/templates/PlayerSheet/primary-attributes.hbs @@ -1,7 +1,11 @@ {{#if hasAttributes}}
{{#each attrs as | attr |}} -
+
{{ attr.name }}