Consolidate both context menus into a single one

This commit is contained in:
Oliver 2026-04-23 21:24:54 -06:00
parent 2cc43bd6e5
commit 3a7ffa4332

View file

@ -110,7 +110,7 @@ export class PlayerSheet extends
if (this.tabGroups.primary === `attributes` && !this.hasAttributesTab) { if (this.tabGroups.primary === `attributes` && !this.hasAttributesTab) {
Logger.debug(`Asserting app "${this.id}" from tab "attributes" to "${initial}"`); Logger.debug(`Asserting app "${this.id}" from tab "attributes" to "${initial}"`);
this.tabGroups.primary = initial; this.tabGroups.primary = initial;
} };
}; };
/** /**
@ -224,33 +224,7 @@ export class PlayerSheet extends
new ContextMenu.implementation( new ContextMenu.implementation(
this.element, this.element,
`li.item`, `[data-item-uuid]`,
[
{
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 },
);
new ContextMenu.implementation(
this.element,
`fieldset.attribute`,
[ [
{ {
label: _loc(`taf.misc.edit`), label: _loc(`taf.misc.edit`),