diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/misc/screen.service.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/client/src/app/shared/misc/screen.service.ts b/client/src/app/shared/misc/screen.service.ts index af75569d9..220d41d59 100644 --- a/client/src/app/shared/misc/screen.service.ts +++ b/client/src/app/shared/misc/screen.service.ts | |||
@@ -22,8 +22,22 @@ export class ScreenService { | |||
22 | return 'ontouchstart' in window || navigator.msMaxTouchPoints | 22 | return 'ontouchstart' in window || navigator.msMaxTouchPoints |
23 | } | 23 | } |
24 | 24 | ||
25 | getNumberOfAvailableMiniatures () { | ||
26 | const screenWidth = this.getWindowInnerWidth() | ||
27 | |||
28 | let numberOfVideos = 1 | ||
29 | |||
30 | if (screenWidth > 1850) numberOfVideos = 6 | ||
31 | else if (screenWidth > 1600) numberOfVideos = 5 | ||
32 | else if (screenWidth > 1370) numberOfVideos = 4 | ||
33 | else if (screenWidth > 1100) numberOfVideos = 3 | ||
34 | else if (screenWidth > 850) numberOfVideos = 2 | ||
35 | |||
36 | return numberOfVideos | ||
37 | } | ||
38 | |||
25 | // Cache window inner width, because it's an expensive call | 39 | // Cache window inner width, because it's an expensive call |
26 | private getWindowInnerWidth () { | 40 | getWindowInnerWidth () { |
27 | if (this.cacheWindowInnerWidthExpired()) this.refreshWindowInnerWidth() | 41 | if (this.cacheWindowInnerWidthExpired()) this.refreshWindowInnerWidth() |
28 | 42 | ||
29 | return this.windowInnerWidth | 43 | return this.windowInnerWidth |