Update to new data bindings, everythings an interface now.

This commit is contained in:
Oliver Rümpelein 2020-12-28 17:34:40 +01:00
parent 78be1c2370
commit 9385917edd
6 changed files with 40 additions and 50 deletions

View file

@ -1,4 +1,3 @@
import { DS4ActorDataType } from "../actor/actor-data";
import { DS4Item } from "./item";
import { DS4ItemDataType } from "./item-data";
@ -26,7 +25,7 @@ export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> {
/* -------------------------------------------- */
/** @override */
getData(): ItemSheetData<DS4ItemDataType> {
getData(): ItemSheetData<DS4ItemDataType, DS4Item> {
const data = { ...super.getData(), config: CONFIG.DS4 };
console.log(data);
return data;
@ -35,11 +34,15 @@ export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> {
/* -------------------------------------------- */
/** @override */
setPosition(options = {}): unknown {
setPosition(options: ApplicationPosition = {}): ApplicationPosition {
const position = super.setPosition(options);
const sheetBody = (this.element as JQuery).find(".sheet-body"); // TODO: Why is the cast necessary?
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if ("find" in this.element) {
const sheetBody = this.element.find(".sheet");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
} else {
console.log("Failure setting position.");
}
return position;
}