mirror of https://github.com/vector-im/riot-web
assign default height after assigning new sections
also apply it to sections with value nullpull/21833/head
parent
eaf212dd89
commit
14485b60be
|
@ -63,9 +63,10 @@ export class Layout {
|
||||||
if (Number.isFinite(availableHeight)) {
|
if (Number.isFinite(availableHeight)) {
|
||||||
this._availableHeight = availableHeight;
|
this._availableHeight = availableHeight;
|
||||||
}
|
}
|
||||||
|
this._sections = sections;
|
||||||
const totalHeight = this._getAvailableHeight();
|
const totalHeight = this._getAvailableHeight();
|
||||||
this._sections.forEach((section, i) => {
|
this._sections.forEach((section, i) => {
|
||||||
if (!this._sectionHeights.hasOwnProperty(section.id)) {
|
if (!this._sectionHeights[section.id]) {
|
||||||
this._sectionHeights[section.id] = clamp(
|
this._sectionHeights[section.id] = clamp(
|
||||||
totalHeight / this._sections.length,
|
totalHeight / this._sections.length,
|
||||||
this._getMinHeight(i),
|
this._getMinHeight(i),
|
||||||
|
@ -73,7 +74,6 @@ export class Layout {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this._sections = sections;
|
|
||||||
this._applyNewSize();
|
this._applyNewSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue