This commit is contained in:
+7
@@ -72,6 +72,7 @@ export class MetadataViewerComponent implements OnInit, OnChanges, AfterViewChec
|
||||
otherItems$!: Observable<MenuItem[]>;
|
||||
downloadMenuItems$!: Observable<MenuItem[]>;
|
||||
bookInSeries: Book[] = [];
|
||||
@ViewChild(Image) private coverImage?: Image;
|
||||
@ViewChild('descriptionContent') descriptionContentRef?: ElementRef<HTMLElement>;
|
||||
isExpanded = false;
|
||||
isOverflowing = false;
|
||||
@@ -104,6 +105,12 @@ export class MetadataViewerComponent implements OnInit, OnChanges, AfterViewChec
|
||||
navigationState$ = this.bookNavigationService.getNavigationState();
|
||||
|
||||
ngOnInit(): void {
|
||||
this.destroyRef.onDestroy(() => this.coverImage?.closePreview());
|
||||
|
||||
const onPopState = () => this.coverImage?.closePreview();
|
||||
window.addEventListener('popstate', onPopState);
|
||||
this.destroyRef.onDestroy(() => window.removeEventListener('popstate', onPopState));
|
||||
|
||||
this.readMenuItems$ = this.book$.pipe(
|
||||
filter((book): book is Book => book !== null),
|
||||
map((book): MenuItem[] => {
|
||||
|
||||
Reference in New Issue
Block a user