Fixed a bug where companion bar would be pushing content to the right even when not visible. Updated nav service localstorage key. (#1159)

This commit is contained in:
Joseph Milazzo 2022-03-16 20:26:51 -05:00 committed by GitHub
parent b1c4b2863c
commit 3a9d6b1a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import { ReplaySubject, take } from 'rxjs';
providedIn: 'root'
})
export class NavService {
public localStorageSideNavKey = 'kavita--sidenav--collapsed';
public localStorageSideNavKey = 'kavita--sidenav--expanded';
private navbarVisibleSource = new ReplaySubject<boolean>(1);
/**

View File

@ -3,8 +3,14 @@
<a id="content"></a>
<app-side-nav *ngIf="navService.sideNavVisibility$ | async"></app-side-nav>
<div class="container-fluid" style="padding-top: 10px; padding-bottom: 10px;">
<div class="companion-bar" [ngClass]="{'companion-bar-content': (navService?.sideNavCollapsed$ | async)}">
<ng-container *ngIf="navService.sideNavVisibility$ | async else noSideNav">
<div class="companion-bar" [ngClass]="{'companion-bar-content': (navService?.sideNavCollapsed$ | async)}">
<router-outlet></router-outlet>
</div>
</ng-container>
<ng-template #noSideNav>
<router-outlet></router-outlet>
</div>
</ng-template>
</div>
</div>

View File

@ -431,9 +431,9 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.navService.showSideNav();
this.onDestroy.next();
this.onDestroy.complete();
this.goToPageEvent.complete();
this.showBookmarkEffectEvent.complete();
this.readerService.exitFullscreen();
if (this.goToPageEvent !== undefined) this.goToPageEvent.complete();
}
@HostListener('window:keyup', ['$event'])