From 8633d2cc4a85d5e679f85fe83b1442b751ae9882 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 11 Jun 2018 15:37:07 +0200 Subject: [PATCH] try #2094 @0.75 --- js/libs/fluidbook/fluidbook.resize.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index d13e475f..2438838a 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -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) { -- 2.39.5