diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js index b3b6d747a1f976a4cde64dca02b1d1ef9f78fee3..959715209552dbc5d95e786417ffb13ee3bca192 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);