Small code style fixs

This commit is contained in:
Zoe Roux 2021-03-06 22:53:30 +01:00
parent 833458ac60
commit d36e332bcb
4 changed files with 16 additions and 16 deletions

View File

@ -1,20 +1,19 @@
import { Component, Input, QueryList, ViewChild, ViewChildren } from "@angular/core"; import { Component, Input, QueryList, ViewChildren } from "@angular/core";
import { MatMenuTrigger } from "@angular/material/menu"; import { MatMenuTrigger } from "@angular/material/menu";
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer, SafeStyle } from "@angular/platform-browser";
import { first } from "rxjs/operators";
import { Episode } from "../../models/resources/episode"; import { Episode } from "../../models/resources/episode";
import { HorizontalScroller } from "../../misc/horizontal-scroller"; import { HorizontalScroller } from "../../misc/horizontal-scroller";
import { Page } from "../../models/page"; import { Page } from "../../models/page";
import { HttpClient } from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
@Component({ @Component({
selector: 'app-episodes-list', selector: "app-episodes-list",
templateUrl: './episodes-list.component.html', templateUrl: "./episodes-list.component.html",
styleUrls: ['./episodes-list.component.scss'] styleUrls: ["./episodes-list.component.scss"]
}) })
export class EpisodesListComponent extends HorizontalScroller export class EpisodesListComponent extends HorizontalScroller
{ {
@Input() displayShowTitle: boolean = false; @Input() displayShowTitle = false;
@Input() episodes: Page<Episode>; @Input() episodes: Page<Episode>;
@ViewChildren(MatMenuTrigger) menus: QueryList<MatMenuTrigger>; @ViewChildren(MatMenuTrigger) menus: QueryList<MatMenuTrigger>;
openedIndex: number = undefined; openedIndex: number = undefined;
@ -24,7 +23,7 @@ export class EpisodesListComponent extends HorizontalScroller
super(); super();
} }
sanitize(url: string) sanitize(url: string): SafeStyle
{ {
return this.sanitizer.bypassSecurityTrustStyle("url(" + url + ")"); return this.sanitizer.bypassSecurityTrustStyle("url(" + url + ")");
} }

View File

@ -78,7 +78,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
text-align: center; text-align: center;
margin-bottom: 0px; margin-bottom: 0;
&.role &.role
{ {

View File

@ -1,7 +1,8 @@
import {Directive, ElementRef, HostListener, Input} from '@angular/core'; import { Directive, ElementRef, HostListener, Input } from "@angular/core";
/* tslint:disable:directive-selector */
@Directive({ @Directive({
selector: 'img[fallback]' selector: "img[fallback]"
}) })
export class FallbackDirective export class FallbackDirective
{ {
@ -10,7 +11,7 @@ export class FallbackDirective
constructor(private img: ElementRef) { } constructor(private img: ElementRef) { }
@HostListener("error") @HostListener("error")
onError() onError(): void
{ {
const html: HTMLImageElement = this.img.nativeElement; const html: HTMLImageElement = this.img.nativeElement;
html.src = this.fallback; html.src = this.fallback;