Fixed the buttons

pull/3996/head
tidusjar 4 years ago
parent 23e9569de5
commit f6ac59edb2

@ -49,10 +49,11 @@ export class DiscoverCardComponent implements OnInit {
} else { } else {
this.tvSearchResult = await this.searchService.getTvInfo(+this.result.id); this.tvSearchResult = await this.searchService.getTvInfo(+this.result.id);
} }
if (this.tvSearchResult?.status.length > 0 && this.tvSearchResult?.status === "404") { if (!this.tvSearchResult || this.tvSearchResult?.status.length > 0 && this.tvSearchResult?.status === "404") {
this.hide = true; this.hide = true;
return; return;
} }
this.setTvDefaults(this.tvSearchResult); this.setTvDefaults(this.tvSearchResult);
this.updateTvItem(this.tvSearchResult); this.updateTvItem(this.tvSearchResult);
@ -161,9 +162,6 @@ export class DiscoverCardComponent implements OnInit {
private setTvDefaults(x: ISearchTvResultV2) { private setTvDefaults(x: ISearchTvResultV2) {
if(!x) {
this.hide = true;
}
if (x.imdbId) { if (x.imdbId) {
x.imdbId = "http://www.imdb.com/title/" + x.imdbId + "/"; x.imdbId = "http://www.imdb.com/title/" + x.imdbId + "/";
} else { } else {

@ -1,8 +1,8 @@
<div class="right"> <div class="right">
<mat-button-toggle-group name="discoverMode" value="{{discoverOptions}}" class="discover-filter-buttons-group"> <mat-button-toggle-group name="discoverMode" (change)="toggleChanged($event)" value="{{discoverOptions}}" class="discover-filter-buttons-group">
<mat-button-toggle ngDefaultControl [class.cdk-focused]="discoverOptions === DiscoverOption.Combined" (click)="switchDiscoverMode(DiscoverOption.Combined)" [(ngModel)]="discoverOptions" value="{{DiscoverOption.Combined}}" class="discover-filter-button">{{'Discovery.Combined' | translate}}</mat-button-toggle> <mat-button-toggle [ngClass]="{'button-active': discoverOptions === DiscoverOption.Combined}" value="{{DiscoverOption.Combined}}" class="discover-filter-button">{{'Discovery.Combined' | translate}}</mat-button-toggle>
<mat-button-toggle ngDefaultControl [class.cdk-focused]="discoverOptions === DiscoverOption.Movie" (click)="switchDiscoverMode(DiscoverOption.Movie)" [(ngModel)]="discoverOptions" value="{{DiscoverOption.Movie}}" class="discover-filter-button">{{'Discovery.Movies' | translate}}</mat-button-toggle> <mat-button-toggle [ngClass]="{'button-active': discoverOptions === DiscoverOption.Movie}" value="{{DiscoverOption.Movie}}" class="discover-filter-button">{{'Discovery.Movies' | translate}}</mat-button-toggle>
<mat-button-toggle ngDefaultControl [class.cdk-focused]="discoverOptions === DiscoverOption.Tv" (click)="switchDiscoverMode(DiscoverOption.Tv)" [(ngModel)]="discoverOptions" value="{{DiscoverOption.Tv}}" class="discover-filter-button">{{'Discovery.Tv' | translate}}</mat-button-toggle> <mat-button-toggle [ngClass]="{'button-active': discoverOptions === DiscoverOption.Tv}" value="{{DiscoverOption.Tv}}" class="discover-filter-button">{{'Discovery.Tv' | translate}}</mat-button-toggle>
</mat-button-toggle-group> </mat-button-toggle-group>
</div> </div>

@ -76,13 +76,14 @@
border-radius: 30px; border-radius: 30px;
} }
.discover-filter-button.cdk-focused{ .button-active{
background:$ombi-active; background:$ombi-active;
} }
::ng-deep .discover-filter-button .mat-button-toggle-button:focus{
outline:none; }
} ::ng-deep .discover-filter-button .mat-button-toggle-button:focus{
outline:none;
} }
.card-skeleton { .card-skeleton {

@ -3,6 +3,7 @@ import { DiscoverOption, IDiscoverCardResult } from "../../interfaces";
import { ISearchMovieResult, ISearchTvResult, RequestType } from "../../../interfaces"; import { ISearchMovieResult, ISearchTvResult, RequestType } from "../../../interfaces";
import { SearchV2Service } from "../../../services"; import { SearchV2Service } from "../../../services";
import { StorageService } from "../../../shared/storage/storage-service"; import { StorageService } from "../../../shared/storage/storage-service";
import { MatButtonToggleChange } from '@angular/material/button-toggle';
export enum DiscoverType { export enum DiscoverType {
Upcoming, Upcoming,
@ -86,7 +87,11 @@ export class CarouselListComponent implements OnInit {
this.createInitialModel(); this.createInitialModel();
} }
public async switchDiscoverMode(newMode: DiscoverOption) { public async toggleChanged(event: MatButtonToggleChange) {
await this.switchDiscoverMode(event.value);
}
private async switchDiscoverMode(newMode: DiscoverOption) {
if (this.discoverOptions === newMode) { if (this.discoverOptions === newMode) {
return; return;
} }

@ -1,6 +1,6 @@
 
<settings-menu></settings-menu> <settings-menu></settings-menu>
<wiki [url]="'https://github.com/tidusjar/Ombi/wiki/Update-Settings'"></wiki> <wiki [path]="'https://github.com/tidusjar/Ombi/wiki/Update-Settings'"></wiki>
<div *ngIf="form" class="small-middle-container"> <div *ngIf="form" class="small-middle-container">
<fieldset> <fieldset>
<legend>Update Settings</legend> <legend>Update Settings</legend>

Loading…
Cancel
Save