From 37cd31ec6b0ee19a7b01dd339a761288d905afa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Mon, 24 Dec 2018 04:22:16 +0100 Subject: [PATCH] c3nav grid should not be above popups and other layers --- src/c3nav/site/static/site/js/c3nav.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/c3nav/site/static/site/js/c3nav.js b/src/c3nav/site/static/site/js/c3nav.js index 24018a69..c9d60292 100644 --- a/src/c3nav/site/static/site/js/c3nav.js +++ b/src/c3nav/site/static/site/js/c3nav.js @@ -1655,7 +1655,7 @@ L.SquareGridLayer = L.Layer.extend({ onAdd: function(map) { this._container = L.DomUtil.create('div', 'leaflet-pane c3nav-grid'); - document.getElementById('map').appendChild(this._container); + this.getPane().appendChild(this._container); this.cols = []; this.rows = []; @@ -1698,12 +1698,17 @@ L.SquareGridLayer = L.Layer.extend({ _updateGrid: function(map) { if (!this.cols || this.cols.length === 0) return; var mapSize = map.getSize(), + panePos = map._getMapPanePos(), 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; + this._container.style.width = mapSize.x+'px'; + this._container.style.height = mapSize.y+'px'; + this._container.style.left = (-panePos.x)+'px'; + this._container.style.top = (-panePos.y)+'px'; for(i=0;i