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,
|
editeffect: DS4ActorSheet.prototype._onEditEffect,
|
||||||
deleteeffect: DS4ActorSheet.prototype._onDeleteEffect,
|
deleteeffect: DS4ActorSheet.prototype._onDeleteEffect,
|
||||||
createeffect: DS4ActorSheet.prototype._onCreateEffect,
|
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 {Event} event - The triggering event
|
||||||
* @param {HTMLElement} target - The target element
|
* @param {HTMLElement} target - The target element
|
||||||
*/
|
*/
|
||||||
|
static async _onEditImage(event, target) {
|
||||||
async _onEditImage(_event, _target) {
|
const field = target.dataset.field || "img";
|
||||||
const attr = "img";
|
const current = foundry.utils.getProperty(this.document, field);
|
||||||
const current = this.document.img;
|
|
||||||
|
|
||||||
const fp = new foundry.applications.apps.FilePicker({
|
const fp = new foundry.applications.apps.FilePicker({
|
||||||
type: "image",
|
type: "image",
|
||||||
current: current,
|
current: current,
|
||||||
callback: (path) => {
|
callback: (path) => this.document.update({ [field]: path })
|
||||||
this.document.update({ [attr]: path });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return fp.browse();
|
return fp.browse();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue