From 944907deb78597a1702f5dce58b8612fa1c7e55b Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Sun, 3 Jan 2021 22:26:36 +0100 Subject: [PATCH] moved input el value retrieval to helper func --- src/module/actor/actor-sheet.ts | 37 ++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index 31536a69..94dcafcd 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -99,7 +99,7 @@ export class DS4ActorSheet extends ActorSheet} ev The originating change event * @private @@ -111,7 +111,6 @@ export class DS4ActorSheet extends ActorSheet, not an Item const property: string = $(ev.currentTarget).data("property"); - let newValue; // Early return: // Disabled => do nothing @@ -121,41 +120,59 @@ export class DS4ActorSheet extends ActorSheet r["checked"]); - // newValue = chosen ? chosen.value : null; + // const value: string = chosen ? chosen.value : null; + // return value; // } // // Multi-Select (untested, cf. FormDataExtended.process) // else if (el.type === "select-multiple") { - // newValue = []; + // const value: Array = []; // el.options.array.forEach((opt: HTMLOptionElement) => { - // if (opt.selected) newValue.push(opt.value); + // if (opt.selected) value.push(opt.value); // }); + // return value; // unsupported: else { throw TypeError("Binding of item property to this type of HTML element not supported; given: " + el); } - setProperty(item, property, newValue); - this.actor.updateOwnedItem(item); } /**