Improve Simple Worldbuilding sheet layout and macro syntax

This commit is contained in:
Andrew 2020-04-18 16:14:51 -07:00
parent 6dbee061d6
commit d405a18f53
8 changed files with 350 additions and 138 deletions

View file

@ -33,14 +33,6 @@ export class SimpleActorSheet extends ActorSheet {
activateListeners(html) {
super.activateListeners(html);
// Activate tabs
let tabs = html.find('.tabs');
let initial = this._sheetTab;
new Tabs(tabs, {
initial: initial,
callback: clicked => this._sheetTab = clicked.data("tab")
});
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
@ -64,6 +56,17 @@ export class SimpleActorSheet extends ActorSheet {
/* -------------------------------------------- */
/** @override */
setPosition(options={}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
/**
* Listen for click events on an attribute control to modify the composition of attributes in the sheet
* @param {MouseEvent} event The originating left click event