diff --git a/src/plugins/bookPlayer/plugin.js b/src/plugins/bookPlayer/plugin.js index 7cdb85d3ca..5e5908cb3f 100644 --- a/src/plugins/bookPlayer/plugin.js +++ b/src/plugins/bookPlayer/plugin.js @@ -267,10 +267,14 @@ export class BookPlayer { const downloadHref = apiClient.getItemDownloadUrl(item.Id); const book = epubjs(downloadHref, {openAs: 'epub'}); + // We need to calculate the height of the window beforehand because using 100% is not accurate when the dialog is opening. + // In addition we don't render to the full height so that we have space for the top buttons. + const clientHeight = document.body.clientHeight; + const renderHeight = clientHeight - (clientHeight * 0.0425); + 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, + height: renderHeight, // TODO: Add option for scrolled-doc flow: 'paginated' }); diff --git a/src/plugins/bookPlayer/style.scss b/src/plugins/bookPlayer/style.scss index df96a9e5c5..c53f6a3a81 100644 --- a/src/plugins/bookPlayer/style.scss +++ b/src/plugins/bookPlayer/style.scss @@ -11,8 +11,6 @@ .topButtons { z-index: 1002; - position: absolute; - top: 0; width: 100%; color: #000; opacity: 0.7;