From 8de6e8b24faf41ce0e6918cb7428f836c1688d56 Mon Sep 17 00:00:00 2001 From: sgiehl <stefan@piwik.org> Date: Mon, 21 Dec 2015 20:19:11 +0100 Subject: [PATCH] fixes #7284 - fix visitor map height calculation bug --- plugins/UserCountryMap/javascripts/visitor-map.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js index b3b6d747a1..9597152095 100644 --- a/plugins/UserCountryMap/javascripts/visitor-map.js +++ b/plugins/UserCountryMap/javascripts/visitor-map.js @@ -1256,12 +1256,18 @@ */ resize: function () { var ratio, w, h, - map = this.map, - maxHeight = $(window).height() - (this.theWidget && this.theWidget.isMaximised ? 150 : 79); + map = this.map; + ratio = map.viewAB.width / map.viewAB.height; w = map.container.width(); h = w / ratio; - h = Math.min(maxHeight, h); + + // special handling for widgetize mode + if (!this.theWidget && map.container.parents('.widget').length) { + var maxHeight = $(window).height() - ($('html').height() - map.container.height()); + h = Math.min(maxHeight, h); + } + map.container.height(h - 2); map.resize(w, h); -- GitLab