Fix show less/more button occluding the list automatically

When the user would click 'show more' they would be presented with a 'show less' button that occluded the last room. 

Similarly, if they resized the list so that all their rooms would be shown and refreshed the page, they would find their last room covered by the button.

This changes the handling so that showAllClick() sets the height to numTiles + button padding, and adjusts the height calculations on render to deal with relative tiles.

This also removes the conditional padding of the resize handle, as we always occupy the 4px of space. It was leading to rooms getting trimmed slightly by the show N button.
This commit is contained in:
Travis Ralston 2020-06-17 22:09:59 -06:00
parent 803b7bb30f
commit 245181cf80
2 changed files with 18 additions and 11 deletions

View file

@ -92,8 +92,12 @@ export class ListLayout {
return this.tilesToPixels(Math.min(maxTiles, n)) + padding;
}
public tilesToPixelsWithPadding(n: number, padding: number): number {
return this.tilesToPixels(n) + padding;
public tilesWithPadding(n: number, paddingPx: number): number {
return this.pixelsToTiles(this.tilesToPixelsWithPadding(n, paddingPx));
}
public tilesToPixelsWithPadding(n: number, paddingPx: number): number {
return this.tilesToPixels(n) + paddingPx;
}
public tilesToPixels(n: number): number {