diff --git a/src/layer/Popup.js b/src/layer/Popup.js index 834a1e66..190cab87 100644 --- a/src/layer/Popup.js +++ b/src/layer/Popup.js @@ -27,7 +27,7 @@ L.Popup = L.Class.extend({ this._map._panes.popupPane.appendChild(this._container); this._map.on('viewreset', this._updatePosition, this); if (this._map.options.closePopupOnClick) { - this._map.on('click', this._close, this); + this._map.on('preclick', this._close, this); } this._update(); diff --git a/src/map/Map.js b/src/map/Map.js index 6e065101..a1382af7 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -399,10 +399,12 @@ L.Map = L.Class.extend({ _onMouseClick: function(e) { if (this.dragging && this.dragging.moved()) { return; } + this._fireMouseEvent(e); }, _fireMouseEvent: function(e) { + this.fire('pre' + e.type); if (!this.hasEventListeners(e.type)) { return; } this.fire(e.type, { latlng: this.mouseEventToLatLng(e),