mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-10 11:10:35 +02:00
Merge pull request #181 from tuur29/feature/mobile-directory-grid-layout
Improve mobile directory grid layout
This commit is contained in:
commit
3c404c0cd5
@ -19,9 +19,13 @@ export class DirectoriesComponent implements OnChanges {
|
||||
}
|
||||
|
||||
private updateSize() {
|
||||
const size = 220 + 5;
|
||||
const containerWidth = this.container.nativeElement.parentElement.clientWidth;
|
||||
this.size = (containerWidth / Math.round((containerWidth / size))) - 5;
|
||||
if (window.innerWidth < window.innerHeight) {
|
||||
// On portrait mode, show 2 directories side by side with some padding
|
||||
this.size = Math.round(window.innerWidth / 2) - 25;
|
||||
} else {
|
||||
const size = 220 + 5;
|
||||
const containerWidth = this.container.nativeElement.parentElement.clientWidth;
|
||||
this.size = (containerWidth / Math.round((containerWidth / size))) - 5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user