Skip to content

Commit

Permalink
Merge pull request jellyfin#2357 from thornbill/fix-epub-height
Browse files Browse the repository at this point in the history
Fix epub player height
  • Loading branch information
dkanada committed Jan 30, 2021
2 parents ec76f40 + 5b86b97 commit 37bb21e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/plugins/bookPlayer/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ export class BookPlayer {
this.id = 'bookplayer';
this.priority = 1;

this.epubOptions = {
width: '100%',
height: '100%',
// TODO: Add option for scrolled-doc
flow: 'paginated'
};

this.onDialogClosed = this.onDialogClosed.bind(this);
this.openTableOfContents = this.openTableOfContents.bind(this);
this.previous = this.previous.bind(this);
Expand Down Expand Up @@ -257,7 +250,14 @@ export class BookPlayer {
import('epubjs').then(({default: epubjs}) => {
const downloadHref = apiClient.getItemDownloadUrl(item.Id);
const book = epubjs(downloadHref, {openAs: 'epub'});
const rendition = book.renderTo('bookPlayerContainer', this.epubOptions);

const rendition = book.renderTo('bookPlayerContainer', {
width: '100%',
// Calculate the height of the window because using 100% is not accurate when the dialog is opening
height: document.body.clientHeight,
// TODO: Add option for scrolled-doc
flow: 'paginated'
});

this.currentSrc = downloadHref;
this.rendition = rendition;
Expand Down

0 comments on commit 37bb21e

Please sign in to comment.