]> _ Git - fluidbook-html5.git/commitdiff
try #2094 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 11 Jun 2018 13:37:07 +0000 (15:37 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 11 Jun 2018 13:37:07 +0000 (15:37 +0200)
js/libs/fluidbook/fluidbook.resize.js

index d13e475ffc6c6d778b2da72002533af0aebddda1..2438838ab1375083e7e9e0d5598e7934cb4dc6d3 100644 (file)
@@ -249,7 +249,12 @@ FluidbookResize.prototype = {
         this.checkLogoVisibility();
 
         $(window).scrollTop(0);
-        $(this.fluidbook).trigger('fluidbook.resize', {ww: this.ww, hh: this.hh, orientation: this.orientation, fluidbookrect: $("#fluidbook").get(0).getBoundingClientRect()});
+        $(this.fluidbook).trigger('fluidbook.resize', {
+            ww: this.ww,
+            hh: this.hh,
+            orientation: this.orientation,
+            fluidbookrect: $("#fluidbook").get(0).getBoundingClientRect()
+        });
     },
     resizeNav: function (interfaceScale) {
         var $this = this;
@@ -384,7 +389,17 @@ FluidbookResize.prototype = {
         var marginBottom;
         var marginTop = marginBottom = Math.min(Math.round(wh * 0.075), 50); // Relative margins with a max of 50
         var searchResultsMaxHeight = wh - formHeight - marginTop - marginBottom;
-        var mainMenuMaxHeight = wh - $('#menuSearch').height() - $('#shareLinks').outerHeight();
+        var shareHeight = 0;
+        var sl=$('#shareLinks');
+        if (sl.length > 0) {
+            shareHeight = sl.outerHeight()
+        }
+        var menuSearchHeight = 0;
+        var ms=$('#menuSearch')
+        if (ms.length > 0) {
+            menuSearchHeight = ms.height();
+        }
+        var mainMenuMaxHeight = wh - menuSearchHeight - shareHeight;
 
         // Search results element may not exist when resize is called
         if (this.fluidbook.search.menuSearchResults == undefined) {