assign default height after assigning new sections

also apply it to sections with value null
This commit is contained in:
Bruno Windels 2019-01-28 16:00:28 +01:00
parent eaf212dd89
commit 14485b60be

View File

@ -63,9 +63,10 @@ export class Layout {
if (Number.isFinite(availableHeight)) {
this._availableHeight = availableHeight;
}
this._sections = sections;
const totalHeight = this._getAvailableHeight();
this._sections.forEach((section, i) => {
if (!this._sectionHeights.hasOwnProperty(section.id)) {
if (!this._sectionHeights[section.id]) {
this._sectionHeights[section.id] = clamp(
totalHeight / this._sections.length,
this._getMinHeight(i),
@ -73,7 +74,6 @@ export class Layout {
);
}
});
this._sections = sections;
this._applyNewSize();
}