From d36e332bcb5c41e7863bfaff22c6c1e04bff1981 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 6 Mar 2021 22:53:30 +0100 Subject: [PATCH] Small code style fixs --- src/app/app.component.scss | 2 +- .../episodes-list/episodes-list.component.ts | 15 +++++++-------- .../people-list/people-list.component.scss | 2 +- src/app/misc/fallback.directive.ts | 13 +++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 11764556..09e84b66 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -33,7 +33,7 @@ { outline: none; color: inherit; - + &:hover { text-decoration: none !important; diff --git a/src/app/components/episodes-list/episodes-list.component.ts b/src/app/components/episodes-list/episodes-list.component.ts index 927a52cd..843b9c3e 100644 --- a/src/app/components/episodes-list/episodes-list.component.ts +++ b/src/app/components/episodes-list/episodes-list.component.ts @@ -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 { DomSanitizer } from "@angular/platform-browser"; -import { first } from "rxjs/operators"; +import { DomSanitizer, SafeStyle } from "@angular/platform-browser"; import { Episode } from "../../models/resources/episode"; import { HorizontalScroller } from "../../misc/horizontal-scroller"; import { Page } from "../../models/page"; import { HttpClient } from "@angular/common/http"; @Component({ - selector: 'app-episodes-list', - templateUrl: './episodes-list.component.html', - styleUrls: ['./episodes-list.component.scss'] + selector: "app-episodes-list", + templateUrl: "./episodes-list.component.html", + styleUrls: ["./episodes-list.component.scss"] }) export class EpisodesListComponent extends HorizontalScroller { - @Input() displayShowTitle: boolean = false; + @Input() displayShowTitle = false; @Input() episodes: Page; @ViewChildren(MatMenuTrigger) menus: QueryList; openedIndex: number = undefined; @@ -24,7 +23,7 @@ export class EpisodesListComponent extends HorizontalScroller super(); } - sanitize(url: string) + sanitize(url: string): SafeStyle { return this.sanitizer.bypassSecurityTrustStyle("url(" + url + ")"); } diff --git a/src/app/components/people-list/people-list.component.scss b/src/app/components/people-list/people-list.component.scss index ed912e60..b08c82b9 100644 --- a/src/app/components/people-list/people-list.component.scss +++ b/src/app/components/people-list/people-list.component.scss @@ -78,7 +78,7 @@ overflow: hidden; text-overflow: ellipsis; text-align: center; - margin-bottom: 0px; + margin-bottom: 0; &.role { diff --git a/src/app/misc/fallback.directive.ts b/src/app/misc/fallback.directive.ts index d20307e4..64d6b398 100644 --- a/src/app/misc/fallback.directive.ts +++ b/src/app/misc/fallback.directive.ts @@ -1,16 +1,17 @@ -import {Directive, ElementRef, HostListener, Input} from '@angular/core'; +import { Directive, ElementRef, HostListener, Input } from "@angular/core"; +/* tslint:disable:directive-selector */ @Directive({ - selector: 'img[fallback]' + selector: "img[fallback]" }) -export class FallbackDirective +export class FallbackDirective { @Input() fallback: string; - + constructor(private img: ElementRef) { } - + @HostListener("error") - onError() + onError(): void { const html: HTMLImageElement = this.img.nativeElement; html.src = this.fallback;