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

@ -29,18 +29,21 @@ export class SimpleItemSheet extends ItemSheet {
/* -------------------------------------------- */
/** @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;
}
/* -------------------------------------------- */
/** @override */
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;