ignore dblclick on SquareGridControl

This commit is contained in:
Laura Klünder 2018-12-12 01:52:35 +01:00
parent a3ecc08e0b
commit 0dbbcbb749

View file

@ -1460,7 +1460,7 @@ SquareGridControl = L.Control.extend({
onAdd: function () { onAdd: function () {
this._container = L.DomUtil.create('div', 'leaflet-control-grid-layer leaflet-bar ' + this.options.addClasses); this._container = L.DomUtil.create('div', 'leaflet-control-grid-layer leaflet-bar ' + this.options.addClasses);
this._button = L.DomUtil.create('a', 'material-icons', this._container); this._button = L.DomUtil.create('a', 'material-icons', this._container);
$(this._button).click(this.toggleGrid); $(this._button).click(this.toggleGrid).dblclick(function(e) { e.stopPropagation(); });
this._button.innerHTML = 'grid_off'; this._button.innerHTML = 'grid_off';
this._button.href = '#'; this._button.href = '#';
this._button.style.color = '#BBBBBB'; this._button.style.color = '#BBBBBB';
@ -1472,10 +1472,7 @@ SquareGridControl = L.Control.extend({
}, },
toggleGrid: function(e) { toggleGrid: function(e) {
if(e) { if(e) e.preventDefault();
e.preventDefault();
e.stopPropagation();
}
if (c3nav._gridControl.gridActive) { if (c3nav._gridControl.gridActive) {
c3nav._gridControl.hideGrid(); c3nav._gridControl.hideGrid();
} else { } else {