Implement the image context menu functionality (closes #148)
This commit is contained in:
parent
af4f0f60a4
commit
002438398b
1 changed files with 9 additions and 4 deletions
|
|
@ -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);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue