Fixed support for Popup closePopupOnClick option.

This commit is contained in:
Jonny Gerig Meyer 2011-06-20 18:07:39 -04:00
parent aa036b93ba
commit 593a3c0380

View File

@ -6,7 +6,7 @@ L.Popup = L.Class.extend({
maxWidth: 300, maxWidth: 300,
autoPan: true, autoPan: true,
closeButton: true, closeButton: true,
closePopupOnClick: true,
offset: new L.Point(0, 2), offset: new L.Point(0, 2),
autoPanPadding: new L.Point(5, 5) autoPanPadding: new L.Point(5, 5)
}, },
@ -26,7 +26,7 @@ L.Popup = L.Class.extend({
this._map._panes.popupPane.appendChild(this._container); this._map._panes.popupPane.appendChild(this._container);
this._map.on('viewreset', this._updatePosition, this); this._map.on('viewreset', this._updatePosition, this);
if (this._map.options.closePopupOnClick) { if (this.options.closePopupOnClick) {
this._map.on('preclick', this._close, this); this._map.on('preclick', this._close, this);
} }
this._update(); this._update();