(Kavita+) External Series Detail (#2309)
This commit is contained in:
parent
bd62e00ec5
commit
6067c9233c
32 changed files with 2354 additions and 726 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
ElementRef,
|
||||
ElementRef, inject,
|
||||
Input,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
|
|
@ -9,9 +9,11 @@ import {CommonModule} from '@angular/common';
|
|||
import {ExternalSeries} from "../../_models/series-detail/external-series";
|
||||
import {RouterLinkActive} from "@angular/router";
|
||||
import {ImageComponent} from "../../shared/image/image.component";
|
||||
import {NgbProgressbar, NgbTooltip} from "@ng-bootstrap/ng-bootstrap";
|
||||
import {NgbActiveOffcanvas, NgbOffcanvas, NgbProgressbar, NgbTooltip} from "@ng-bootstrap/ng-bootstrap";
|
||||
import {ReactiveFormsModule} from "@angular/forms";
|
||||
import {TranslocoDirective} from "@ngneat/transloco";
|
||||
import {SeriesPreviewDrawerComponent} from "../../_single-module/series-preview-drawer/series-preview-drawer.component";
|
||||
import {SeriesService} from "../../_services/series.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-external-series-card',
|
||||
|
|
@ -23,9 +25,23 @@ import {TranslocoDirective} from "@ngneat/transloco";
|
|||
})
|
||||
export class ExternalSeriesCardComponent {
|
||||
@Input({required: true}) data!: ExternalSeries;
|
||||
/**
|
||||
* When clicking on the series, instead of opening, opens a preview drawer
|
||||
*/
|
||||
@Input() previewOnClick: boolean = false;
|
||||
@ViewChild('link', {static: false}) link!: ElementRef<HTMLAnchorElement>;
|
||||
|
||||
private readonly offcanvasService = inject(NgbOffcanvas);
|
||||
|
||||
handleClick() {
|
||||
if (this.previewOnClick) {
|
||||
const ref = this.offcanvasService.open(SeriesPreviewDrawerComponent, {position: 'end', panelClass: 'navbar-offset'});
|
||||
ref.componentInstance.isExternalSeries = true;
|
||||
ref.componentInstance.aniListId = this.data.aniListId;
|
||||
ref.componentInstance.malId = this.data.malId;
|
||||
ref.componentInstance.name = this.data.name;
|
||||
return;
|
||||
}
|
||||
if (this.link) {
|
||||
this.link.nativeElement.click();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue