Attribute Item Subtype #76
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() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
{{#if hasAttributes}}
|
||||
<div class="attributes">
|
||||
{{#each attrs as | attr |}}
|
||||
<fieldset data-foreign-uuid="{{ attr.uuid }}">
|
||||
<fieldset
|
||||
class="attribute"
|
||||
data-item-uuid="{{ attr.uuid }}"
|
||||
data-foreign-uuid="{{ attr.uuid }}"
|
||||
>
|
||||
<legend>
|
||||
{{ attr.name }}
|
||||
</legend>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue