More Bugfixes from Side Nav (#1162)

* Fixed a bug where the bottom of the page could be cut off

* Adjusted all the headings to h2, which looks better

* Refactored GetSeriesDetail to actually map the names inside the code so the UI just displays.

* Put in some basic improvements to OPDS by using Series Detail type layout, but this only reduces one click.

* Fixed a bug where offset from scrollbar fix causes readers to be cutoff.
This commit is contained in:
Joseph Milazzo 2022-03-17 20:27:39 -05:00 committed by GitHub
parent 5220d2b300
commit bff49c0e7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 114 additions and 54 deletions

View file

@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { Inject, Injectable, Renderer2, RendererFactory2 } from '@angular/core';
import { ReplaySubject, take } from 'rxjs';
@Injectable({
@ -25,7 +26,10 @@ export class NavService {
*/
sideNavVisibility$ = this.sideNavVisibilitySource.asObservable();
constructor() {
private renderer: Renderer2;
constructor(@Inject(DOCUMENT) private document: Document, rendererFactory: RendererFactory2) {
this.renderer = rendererFactory.createRenderer(null, null);
this.showNavBar();
const sideNavState = (localStorage.getItem(this.localStorageSideNavKey) === 'true') || false;
this.sideNavCollapseSource.next(sideNavState);
@ -36,6 +40,7 @@ export class NavService {
* Shows the top nav bar. This should be visible on all pages except the reader.
*/
showNavBar() {
this.renderer.setStyle(this.document.querySelector('body'), 'margin-top', '56px');
this.navbarVisibleSource.next(true);
}
@ -43,6 +48,7 @@ export class NavService {
* Hides the top nav bar.
*/
hideNavBar() {
this.renderer.setStyle(this.document.querySelector('body'), 'margin-top', '0px');
this.navbarVisibleSource.next(false);
}