]> _ Git - fluidbook-html5.git/commitdiff
wip #7712 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Sep 2025 13:31:22 +0000 (15:31 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Sep 2025 13:31:22 +0000 (15:31 +0200)
js/libs/fluidbook/fluidbook.menu.js

index dea04c8419f6924bbdc69f15d9756ff0b87172cc..b37c744207d3c1ac1cb39935a79a9643981b39dd 100644 (file)
@@ -156,7 +156,7 @@ FluidbookMenu.prototype = {
         let $this = this;
         var infos = this.fluidbook.settings.pdfLinks[uid];
         let c = this.getCaption('', 'nocaption', 'nocaption');
-        c += '<div class="content"><div class="pdf-holder"><iframe class="pdf view ' + infos.interface + '" data-width="' + infos.width + '" data-height="' + infos.height + '" data-total-height="' + infos.totalHeight + '" frameborder="0" scrolling="no" src="pdfjs/web/viewer.'+this.fluidbook.settings.htmlExtension+'?&file=../../data/links/' + infos.file + '#zoom=page-width"></iframe></div></div>';
+        c += '<div class="content"><div class="pdf-holder"><iframe class="pdf view ' + infos.interface + '" data-width="' + infos.width + '" data-height="' + infos.height + '" data-total-height="' + infos.totalHeight + '" frameborder="0" scrolling="no" src="pdfjs/web/viewer.' + this.fluidbook.settings.htmlExtension + '?&file=../../data/links/' + infos.file + '#zoom=page-width"></iframe></div></div>';
         this.viewWrap(c, 'pdf', '', 'pdf');
         if (callback != undefined) {
             callback();
@@ -1186,7 +1186,7 @@ FluidbookMenu.prototype = {
             if ($(".indexViewHolder").find('.doubleThumb:not(.simple)').length > 0) {
                 baseWidth = 230;
             }
-            var indexWidth = Math.floor(w / baseWidth) * baseWidth;
+            var indexWidth = Math.max(1, Math.floor(w / baseWidth)) * baseWidth;
 
             $(".indexViewHolder").css('width', indexWidth);
         }