mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 13:53: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%;
|
max-width: 100%;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
.small-middle-container{
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-group {
|
.btn-group {
|
||||||
width:100%;
|
width:100%;
|
||||||
|
@ -161,6 +158,7 @@
|
||||||
min-width: 20%;
|
min-width: 20%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1600px) {
|
@media (min-width: 1600px) {
|
||||||
.col-xl-2 {
|
.col-xl-2 {
|
||||||
flex: 0 0 16.66666667%;
|
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 { SearchV2Service } from "../../../services";
|
||||||
import { ISearchMovieResult, ISearchTvResult, RequestType } from "../../../interfaces";
|
import { ISearchMovieResult, ISearchTvResult, RequestType } from "../../../interfaces";
|
||||||
import { IDiscoverCardResult, DiscoverOption } from "../../interfaces";
|
import { IDiscoverCardResult, DiscoverOption } from "../../interfaces";
|
||||||
import { trigger, transition, style, animate } from "@angular/animations";
|
import { trigger, transition, style, animate } from "@angular/animations";
|
||||||
import { StorageService } from "../../../shared/storage/storage-service";
|
import { StorageService } from "../../../shared/storage/storage-service";
|
||||||
|
import { DOCUMENT } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./discover.component.html",
|
templateUrl: "./discover.component.html",
|
||||||
|
@ -42,7 +43,9 @@ export class DiscoverComponent implements OnInit {
|
||||||
private mediaTypeStorageKey = "DiscoverOptions";
|
private mediaTypeStorageKey = "DiscoverOptions";
|
||||||
|
|
||||||
constructor(private searchService: SearchV2Service,
|
constructor(private searchService: SearchV2Service,
|
||||||
private storageService: StorageService) { }
|
private storageService: StorageService,
|
||||||
|
@Inject(DOCUMENT) private container: Document) { }
|
||||||
|
|
||||||
|
|
||||||
public async ngOnInit() {
|
public async ngOnInit() {
|
||||||
this.loading()
|
this.loading()
|
||||||
|
@ -68,6 +71,9 @@ export class DiscoverComponent implements OnInit {
|
||||||
|
|
||||||
this.createInitialModel();
|
this.createInitialModel();
|
||||||
this.scrollDisabled = false;
|
this.scrollDisabled = false;
|
||||||
|
if (!this.containerHasScrollBar()) {
|
||||||
|
await this.onScroll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async onScroll() {
|
public async onScroll() {
|
||||||
|
@ -242,7 +248,7 @@ export class DiscoverComponent implements OnInit {
|
||||||
this.movies.forEach(m => {
|
this.movies.forEach(m => {
|
||||||
tempResults.push({
|
tempResults.push({
|
||||||
available: m.available,
|
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,
|
requested: m.requested,
|
||||||
title: m.title,
|
title: m.title,
|
||||||
type: RequestType.movie,
|
type: RequestType.movie,
|
||||||
|
@ -301,4 +307,11 @@ export class DiscoverComponent implements OnInit {
|
||||||
private finishLoading() {
|
private finishLoading() {
|
||||||
this.loadingFlag = false;
|
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