fix min & max size for empty sublists

pull/21833/head
Bruno Windels 2019-01-15 12:56:33 +01:00
parent 1bbf1502ec
commit aa90e9591a
1 changed files with 4 additions and 3 deletions

View File

@ -35,14 +35,15 @@ class RoomSubListItem extends ResizeItem {
} }
maxSize() { maxSize() {
const scrollItem = this.domNode.querySelector(".mx_RoomSubList_scroll");
const header = this.domNode.querySelector(".mx_RoomSubList_labelContainer"); const header = this.domNode.querySelector(".mx_RoomSubList_labelContainer");
const scrollItem = this.domNode.querySelector(".mx_RoomSubList_scroll");
const headerHeight = this.sizer.getItemSize(header); const headerHeight = this.sizer.getItemSize(header);
return headerHeight + scrollItem.scrollHeight; return headerHeight + (scrollItem ? scrollItem.scrollHeight : 0);
} }
minSize() { minSize() {
return 74; //size of header + 1 room tile const isNotEmpty = this.domNode.classList.contains("mx_RoomSubList_nonEmpty");
return isNotEmpty ? 74 : 31; //size of header + 1? room tile (see room sub list css)
} }
isSized() { isSized() {