Made Marker openPopup fail silently, closed #507

This commit is contained in:
mourner 2012-02-21 15:07:54 +02:00
parent 60f96281e7
commit 7889b692b0
4 changed files with 6 additions and 7 deletions

View File

@ -46,6 +46,7 @@ An in-progress version being developed on the master branch.
* Added chaining to `DomEvent` methods.
* Added `Map` `addHandler` method.
* Moved dragging cursor styles from JS code to CSS.
* Improved `Marker` `openPopup` not to raise an error if it doesn't have a popup. [#507](https://github.com/CloudMade/Leaflet/issues/507)
### Bug fixes

5
dist/leaflet-src.js vendored
View File

@ -2681,9 +2681,8 @@ L.Popup = L.Class.extend({
L.Marker.include({
openPopup: function () {
this._popup.setLatLng(this._latlng);
if (this._map) {
if (this._popup && this._map) {
this._popup.setLatLng(this._latlng);
this._map.openPopup(this._popup);
}

2
dist/leaflet.js vendored

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,8 @@
L.Marker.include({
openPopup: function () {
this._popup.setLatLng(this._latlng);
if (this._map) {
if (this._popup && this._map) {
this._popup.setLatLng(this._latlng);
this._map.openPopup(this._popup);
}