Implement the image context menu functionality (closes #148)

This commit is contained in:
Oliver-Akins 2024-04-20 16:52:37 -06:00
parent af4f0f60a4
commit 002438398b

View file

@ -29,15 +29,20 @@ export class UntypedItemSheet extends GenericItemSheet {
new GenericContextMenu(html, `.photo.panel`, [ new GenericContextMenu(html, `.photo.panel`, [
{ {
name: `View Larger`, name: `View Larger`,
callback: (html) => { callback: () => {
console.log(`.dungeon | View Larger`); (new ImagePopout(this.item.img)).render(true);
}, },
}, },
{ {
name: `Change Photo`, name: `Change Photo`,
condition: () => this.isEditable, condition: () => this.isEditable,
callback: (html) => { callback: () => {
console.log(`.dungeon | Change Photo`); const fp = new FilePicker({
callback: (path) => {
this.item.update({"img": path});
},
});
fp.render(true);
}, },
}, },
]); ]);