stopPropagation

This commit is contained in:
Laura Klünder 2018-12-12 01:48:44 +01:00
parent 5248f970e4
commit 7bdbd25fc2

View file

@ -1487,7 +1487,10 @@ SquareGridControl = L.Control.extend({
}, },
toggleGrid: function(e) { toggleGrid: function(e) {
if(e) e.preventDefault(); if(e) {
e.preventDefault();
e.stopPropagation();
}
if (c3nav._gridControl.gridActive) { if (c3nav._gridControl.gridActive) {
c3nav._gridControl.hideGrid(); c3nav._gridControl.hideGrid();
} else { } else {
@ -1562,7 +1565,6 @@ L.SquareGridLayer = L.Layer.extend({
}, },
_updateGrid: function(map) { _updateGrid: function(map) {
var mapSize = map.getSize(), coord = null, lastCoord = null, size; var mapSize = map.getSize(), coord = null, lastCoord = null, size;
for(i=0;i<this.config.cols.length;i++) { for(i=0;i<this.config.cols.length;i++) {
coord = map.latLngToContainerPoint([0, this.config.cols[i]], map.getZoom()).x; coord = map.latLngToContainerPoint([0, this.config.cols[i]], map.getZoom()).x;