From 18c45993fe3ae2d1ec2597e251cf768075e21dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Wed, 12 Dec 2018 16:56:13 +0100 Subject: [PATCH] avoid bottom right controls properly --- src/c3nav/site/static/site/js/c3nav.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c3nav/site/static/site/js/c3nav.js b/src/c3nav/site/static/site/js/c3nav.js index 0189a72c..f40ced7f 100644 --- a/src/c3nav/site/static/site/js/c3nav.js +++ b/src/c3nav/site/static/site/js/c3nav.js @@ -1555,6 +1555,7 @@ L.SquareGridLayer = L.Layer.extend({ var mapSize = map.getSize(), sidebarStart = $('#sidebar').outerWidth() + 15, searchHeight = $('#search').outerHeight() + 10, + controlsWidth = $('.leaflet-control-zoom').outerWidth() + 10, attributionStart = mapSize.x - $('.leaflet-control-attribution').outerWidth() - 16, bottomRightStart = mapSize.y - $('.leaflet-bottom.leaflet-right').outerHeight() - 24, coord = null, lastCoord = null, size, center; @@ -1586,7 +1587,7 @@ L.SquareGridLayer = L.Layer.extend({ if (size > 0) { this.rows[i].style.display = ''; this.rows[i].style.height = size+'px'; - this.rows[i].style.paddingRight = Math.max(0, Math.min(36, (center-bottomRightStart)*2)) + 'px'; + this.rows[i].style.paddingRight = Math.max(0, Math.min(controlsWidth, (center-bottomRightStart)/16*controlsWidth)) + 'px'; } else { this.rows[i].style.display = 'none'; }