Merge pull request #289 from adityachandelgit/develop

Marge Develop into Master for Release
This commit is contained in:
Aditya Chandel
2025-05-17 11:41:22 -06:00
committed by GitHub
3 changed files with 9 additions and 4 deletions
@@ -42,7 +42,7 @@
<div id="epubContainer" #epubContainer></div> <div id="epubContainer" #epubContainer></div>
<button class="epub-controls-left" (click)="prevPage()">←</button> <button *ngIf="!isMobile" class="epub-controls-left" (click)="prevPage()">←</button>
<button class="epub-controls-right" (click)="nextPage()">→</button> <button *ngIf="!isMobile" class="epub-controls-right" (click)="nextPage()">→</button>
</div> </div>
</div> </div>
@@ -60,6 +60,7 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
currentChapter = ''; currentChapter = '';
isDrawerVisible = false; isDrawerVisible = false;
isSettingsDrawerVisible = false; isSettingsDrawerVisible = false;
isMobile = false;
private book: any; private book: any;
private rendition: any; private rendition: any;
private keyListener: (e: KeyboardEvent) => void = () => { private keyListener: (e: KeyboardEvent) => void = () => {
@@ -114,6 +115,8 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
fileReader.onload = () => { fileReader.onload = () => {
this.book = ePub(fileReader.result as ArrayBuffer); this.book = ePub(fileReader.result as ArrayBuffer);
this.isMobile = window.innerWidth <= 768;
this.book.loaded.navigation.then((nav: any) => { this.book.loaded.navigation.then((nav: any) => {
this.chapters = nav.toc.map((chapter: any) => ({ this.chapters = nav.toc.map((chapter: any) => ({
label: chapter.label, label: chapter.label,
@@ -122,7 +125,8 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
}); });
this.rendition = this.book.renderTo(this.epubContainer.nativeElement, { this.rendition = this.book.renderTo(this.epubContainer.nativeElement, {
flow: 'paginated', flow: this.isMobile ? 'scrolled' : 'paginated',
manager: this.isMobile ? 'continuous' : 'default',
width: '100%', width: '100%',
height: '100%', height: '100%',
allowScriptedContent: true, allowScriptedContent: true,
@@ -35,7 +35,8 @@
&.layout-static { &.layout-static {
.layout-main-container { .layout-main-container {
margin-left: 208px; padding-left: 255px;
box-sizing: border-box;
} }
&.layout-static-inactive { &.layout-static-inactive {