diff options
author | sgiehl <stefan@piwik.org> | 2015-12-21 22:19:11 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-12-21 22:19:11 +0300 |
commit | 8de6e8b24faf41ce0e6918cb7428f836c1688d56 (patch) | |
tree | b2ec5956823d284a5f2e3eb136f2951dfddb26d5 /plugins/UserCountryMap/javascripts | |
parent | 74ca91646cc3f20449d591d0587ff473dbfab79c (diff) |
fixes #7284 - fix visitor map height calculation bug
Diffstat (limited to 'plugins/UserCountryMap/javascripts')
-rw-r--r-- | plugins/UserCountryMap/javascripts/visitor-map.js | 12 |
1 files 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); |