mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Fixed the issue for larger devices not scrolling, also fixed the funny scroll issue on mobile devices
This commit is contained in:
parent
d1a172758d
commit
23be71d8d9
2 changed files with 31 additions and 20 deletions
|
@ -49,9 +49,6 @@
|
|||
max-width: 100%;
|
||||
min-width: 100%;
|
||||
}
|
||||
.small-middle-container{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
width:100%;
|
||||
|
@ -61,16 +58,16 @@
|
|||
width:100%;
|
||||
}
|
||||
|
||||
.col{
|
||||
.col {
|
||||
padding-right: 10px !important;
|
||||
padding-left:10px !important;
|
||||
}
|
||||
|
||||
.row{
|
||||
.row {
|
||||
margin-left:0px;
|
||||
}
|
||||
|
||||
.small-padding{
|
||||
.small-padding {
|
||||
padding-left: 5px !important;
|
||||
padding-right: 0px !important;
|
||||
height: 40em;
|
||||
|
@ -161,6 +158,7 @@
|
|||
min-width: 20%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1600px) {
|
||||
.col-xl-2 {
|
||||
flex: 0 0 16.66666667%;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import { Component, OnInit } from "@angular/core";
|
||||
import { Component, OnInit, Inject } from "@angular/core";
|
||||
import { SearchV2Service } from "../../../services";
|
||||
import { ISearchMovieResult, ISearchTvResult, RequestType } from "../../../interfaces";
|
||||
import { IDiscoverCardResult, DiscoverOption } from "../../interfaces";
|
||||
import { trigger, transition, style, animate } from "@angular/animations";
|
||||
import { StorageService } from "../../../shared/storage/storage-service";
|
||||
import { DOCUMENT } from "@angular/common";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./discover.component.html",
|
||||
|
@ -42,7 +43,9 @@ export class DiscoverComponent implements OnInit {
|
|||
private mediaTypeStorageKey = "DiscoverOptions";
|
||||
|
||||
constructor(private searchService: SearchV2Service,
|
||||
private storageService: StorageService) { }
|
||||
private storageService: StorageService,
|
||||
@Inject(DOCUMENT) private container: Document) { }
|
||||
|
||||
|
||||
public async ngOnInit() {
|
||||
this.loading()
|
||||
|
@ -68,6 +71,9 @@ export class DiscoverComponent implements OnInit {
|
|||
|
||||
this.createInitialModel();
|
||||
this.scrollDisabled = false;
|
||||
if (!this.containerHasScrollBar()) {
|
||||
await this.onScroll();
|
||||
}
|
||||
}
|
||||
|
||||
public async onScroll() {
|
||||
|
@ -242,7 +248,7 @@ export class DiscoverComponent implements OnInit {
|
|||
this.movies.forEach(m => {
|
||||
tempResults.push({
|
||||
available: m.available,
|
||||
posterPath: m.posterPath ? `https://image.tmdb.org/t/p/w300/${m.posterPath}` : "../../../images/default_movie_poster.png",
|
||||
posterPath: m.posterPath ? `https://image.tmdb.org/t/p/w500/${m.posterPath}` : "../../../images/default_movie_poster.png",
|
||||
requested: m.requested,
|
||||
title: m.title,
|
||||
type: RequestType.movie,
|
||||
|
@ -301,4 +307,11 @@ export class DiscoverComponent implements OnInit {
|
|||
private finishLoading() {
|
||||
this.loadingFlag = false;
|
||||
}
|
||||
|
||||
private containerHasScrollBar(): boolean {
|
||||
return
|
||||
// div.scrollHeight > div.clientHeight;
|
||||
this.container.documentElement.scrollHeight > this.container.documentElement.clientHeight;
|
||||
// this.container.documentElement.scrollHeight > (window.innerHeight + window.pageYOffset);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue