From 002438398b4f98e09d8266c3a34434776d5b5c74 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 20 Apr 2024 16:52:37 -0600 Subject: [PATCH] Implement the image context menu functionality (closes #148) --- module/sheets/Items/UntypedItemSheet.mjs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/module/sheets/Items/UntypedItemSheet.mjs b/module/sheets/Items/UntypedItemSheet.mjs index a62b7dd..4c81cb5 100644 --- a/module/sheets/Items/UntypedItemSheet.mjs +++ b/module/sheets/Items/UntypedItemSheet.mjs @@ -29,15 +29,20 @@ export class UntypedItemSheet extends GenericItemSheet { new GenericContextMenu(html, `.photo.panel`, [ { name: `View Larger`, - callback: (html) => { - console.log(`.dungeon | View Larger`); + callback: () => { + (new ImagePopout(this.item.img)).render(true); }, }, { name: `Change Photo`, condition: () => this.isEditable, - callback: (html) => { - console.log(`.dungeon | Change Photo`); + callback: () => { + const fp = new FilePicker({ + callback: (path) => { + this.item.update({"img": path}); + }, + }); + fp.render(true); }, }, ]);