From 5b86b97e635fdc5b0a7780bd0928091c703c8feb Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Thu, 28 Jan 2021 14:03:26 -0500 Subject: [PATCH] Fix epub player height --- src/plugins/bookPlayer/plugin.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/bookPlayer/plugin.js b/src/plugins/bookPlayer/plugin.js index ba016a514db..c761d9c21cd 100644 --- a/src/plugins/bookPlayer/plugin.js +++ b/src/plugins/bookPlayer/plugin.js @@ -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); @@ -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;