From 5dcb3715c814bc2d915624b553842f1a377204f5 Mon Sep 17 00:00:00 2001 From: ParthAggarwal16 Date: Fri, 30 Jan 2026 14:15:16 +0530 Subject: [PATCH] fix: correct footer height calculation when bottom offset is applied --- src/BookReader.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/BookReader.js b/src/BookReader.js index a307d3eba..0b9f0f8f0 100644 --- a/src/BookReader.js +++ b/src/BookReader.js @@ -1776,15 +1776,14 @@ BookReader.prototype.reloadImages = function() { * @return {number} */ BookReader.prototype.getFooterHeight = function() { - const $heightEl = this.mode == this.constMode2up ? this.refs.$BRfooter : this.refs.$BRnav; - if ($heightEl && this.refs.$BRfooter) { - const outerHeight = $heightEl.outerHeight(); - const bottom = parseInt(this.refs.$BRfooter.css('bottom')); - if (!isNaN(outerHeight) && !isNaN(bottom)) { - return outerHeight + bottom; - } - } - return 0; + const $footer = this.refs.$BRfooter; + if (!$footer || !$footer.length) { + return 0; + } + const outerHeight = $footer.outerHeight() || 0; + const bottomCss = $footer.css('bottom') || '0'; + const bottom = parseInt(bottomCss, 10) || 0; + return outerHeight + bottom; }; // Basic Usage built-in Methods (can be overridden through options)