Fixing the invinite scroller

This commit is contained in:
Zoe Roux 2020-11-16 22:35:51 +01:00
parent f764d8bbae
commit 80f80960c9
4 changed files with 13 additions and 7 deletions

View File

@ -89,7 +89,8 @@
</div>
</mat-menu>
<div class="container-fluid justify-content-center" infinite-scroll (scrolled)="this.page?.loadNext(this.client)">
<div class="container-fluid justify-content-center"
infinite-scroll (scrolled)="this.page?.loadNext(this.client)" infiniteScrollContainer="#main" fromRoot="true">
<a class="show" *ngFor="let item of this.page?.items" [href]="getLink(item)" [routerLink]="getLink(item)">
<div matRipple [style.background-image]="getThumb(item.slug)"></div>
<p class="title">{{item.title ? item.title : item.name}}</p>

View File

@ -20,7 +20,7 @@
{{alias}}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>
<input #aliasInput placeholder="New alias..." [matChipInputFor]="aliasList" (matChipInputTokenEnd)="addAlias($event)" />
<input placeholder="New alias..." [matChipInputFor]="aliasList" (matChipInputTokenEnd)="addAlias($event)" />
</mat-chip-list>
</mat-form-field>
@ -75,6 +75,7 @@
<mat-form-field class="w-100">
<mat-label>Studio</mat-label>
<input matInput [value]="this.show.studio?.name"
[formControl]="studioForm"
(input)="this.show.studio = {id: 0, slug: null, name: $event.target.value};"
[matAutocomplete]="studioAuto" name="studio">
<mat-autocomplete #studioAuto="matAutocomplete" (optionSelected)="this.show.studio = $event.option.value">
@ -105,7 +106,11 @@
<div mat-dialog-actions align="end">
<button mat-button mat-dialog-close>Cancel</button>
<button mat-button (click)="apply()">
<mat-icon *ngIf="this.metadataChanged" style="color: red;" class="mr-2" matTooltip="You changed an external id, the whole show's metadata will be refreshed. Individual changes made won't last." matTooltipPosition="above">warning</mat-icon>
<mat-icon *ngIf="this.metadataChanged"
style="color: red;"
class="mr-2"
matTooltip="You changed an external id, the whole show's metadata will be refreshed. Individual changes made won't last."
matTooltipPosition="above">warning</mat-icon>
Apply
</button>
</div>

View File

@ -13,7 +13,7 @@ import { Studio } from "../../models/resources/studio";
import { Provider } from "../../models/provider";
import { MatSnackBar } from "@angular/material/snack-bar";
import { ShowGridComponent } from "../../components/show-grid/show-grid.component";
import { GenreService, StudioService } from "../../services/api.service";
import { GenreService, ShowService, StudioService } from "../../services/api.service";
@Component({
selector: 'app-metadata-edit',
@ -38,6 +38,7 @@ export class MetadataEditComponent implements OnInit
constructor(public dialogRef: MatDialogRef<MetadataEditComponent>,
@Inject(MAT_DIALOG_DATA) public show: Show,
private http: HttpClient,
private showsApi: ShowService,
private studioApi: StudioService,
private genreApi: GenreService,
private snackBar: MatSnackBar)
@ -97,7 +98,7 @@ export class MetadataEditComponent implements OnInit
}
else
{
this.http.post("/api/show/edit/" + this.show.slug, this.show).subscribe(() =>
this.showsApi.edit(this.show).subscribe(() =>
{
this.dialogRef.close(this.show);
});

View File

@ -1,4 +1,4 @@
import { AfterViewInit, Component, HostListener, OnInit } from "@angular/core";
import { AfterViewInit, Component } from "@angular/core";
import { MatSnackBar } from "@angular/material/snack-bar";
import { DomSanitizer, Title } from "@angular/platform-browser";
import {ActivatedRoute, Router} from '@angular/router';
@ -88,7 +88,6 @@ export class ShowDetailsComponent implements AfterViewInit
scroll()
{
console.log("scroll");
let opacity: number = 2 * this.scrollZone.scrollTop / this.backdrop.clientHeight;
this.toolbar.setAttribute("style", `background-color: rgba(0, 0, 0, ${opacity}) !important`);
};