Change the scrolling from the whole sheet content to the sheet body only #450

Merged
marafal merged 1 commits from refactor-scrolling-in-sheets-body into v1.4 2021-05-09 19:09:03 +02:00
5 changed files with 17 additions and 16 deletions

View File

@ -70,17 +70,6 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
}); });
} }
/* -------------------------------------------- */
/** @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 */ /** @override */
_updateObject(event, formData) { _updateObject(event, formData) {

View File

@ -134,8 +134,10 @@ export class RdDActorEntiteSheet extends ActorSheet {
/** @override */ /** @override */
setPosition(options = {}) { setPosition(options = {}) {
const position = super.setPosition(options); const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetTabs = this.element.find(".sheet-tabs");
const sheetBody = this.element.find(".sheet-body"); const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192; const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
sheetBody.css("height", bodyHeight); sheetBody.css("height", bodyHeight);
return position; return position;
} }

View File

@ -608,8 +608,10 @@ export class RdDActorSheet extends ActorSheet {
/** @override */ /** @override */
setPosition(options = {}) { setPosition(options = {}) {
const position = super.setPosition(options); const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetTabs = this.element.find(".sheet-tabs");
const sheetBody = this.element.find(".sheet-body"); const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192; const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
sheetBody.css("height", bodyHeight); sheetBody.css("height", bodyHeight);
return position; return position;
} }

View File

@ -110,8 +110,10 @@ export class RdDActorVehiculeSheet extends ActorSheet {
/** @override */ /** @override */
setPosition(options = {}) { setPosition(options = {}) {
const position = super.setPosition(options); const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetTabs = this.element.find(".sheet-tabs");
const sheetBody = this.element.find(".sheet-body"); const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192; const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
sheetBody.css("height", bodyHeight); sheetBody.css("height", bodyHeight);
return position; return position;
} }

View File

@ -322,6 +322,12 @@ table {border: 1px solid #7a7971;}
height: 100%; height: 100%;
} }
.sheet .window-content {overflow: hidden;}
.sheet .window-content .sheet-header {overflow: hidden;}
.sheet .window-content .sheet-tabs {overflow: hidden;}
.sheet .window-content .sheet-body {overflow-y: scroll;}
.sheet .window-content .sheet-body .tab {padding-bottom: 30px;}
.editor { .editor {
border: 2; border: 2;
height: 300px; height: 300px;