Add the item UUID into the fieldset and add a context menu to edit/delete primary attributes
This commit is contained in:
parent
60d29adc3e
commit
e9d92d3db1
2 changed files with 31 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue