fix: update _onEditImage to proper V2 static method pattern
- Convert _onEditImage from instance to static method
This commit is contained in:
parent
e40c201dce
commit
97ea5e8cc4
1 changed files with 5 additions and 8 deletions
|
@ -43,7 +43,7 @@ export class DS4ActorSheet extends foundry.applications.api.HandlebarsApplicatio
|
|||
editeffect: DS4ActorSheet.prototype._onEditEffect,
|
||||
deleteeffect: DS4ActorSheet.prototype._onDeleteEffect,
|
||||
createeffect: DS4ActorSheet.prototype._onCreateEffect,
|
||||
editImage: DS4ActorSheet.prototype._onEditImage,
|
||||
editImage: DS4ActorSheet._onEditImage,
|
||||
|
||||
},
|
||||
};
|
||||
|
@ -615,17 +615,14 @@ export class DS4ActorSheet extends foundry.applications.api.HandlebarsApplicatio
|
|||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
|
||||
async _onEditImage(_event, _target) {
|
||||
const attr = "img";
|
||||
const current = this.document.img;
|
||||
static async _onEditImage(event, target) {
|
||||
const field = target.dataset.field || "img";
|
||||
const current = foundry.utils.getProperty(this.document, field);
|
||||
|
||||
const fp = new foundry.applications.apps.FilePicker({
|
||||
type: "image",
|
||||
current: current,
|
||||
callback: (path) => {
|
||||
this.document.update({ [attr]: path });
|
||||
}
|
||||
callback: (path) => this.document.update({ [field]: path })
|
||||
});
|
||||
|
||||
return fp.browse();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue