From 5fec57d8ec4ba46a946f83cc0490efaf14b36ff3 Mon Sep 17 00:00:00 2001 From: Adam Bramley Date: Thu, 21 Nov 2013 09:16:10 +1300 Subject: [PATCH] Adds a check to make sure the closeButton option is set before focusing --- src/layer/marker/Marker.Popup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/layer/marker/Marker.Popup.js b/src/layer/marker/Marker.Popup.js index 885bba7b..b51a653e 100644 --- a/src/layer/marker/Marker.Popup.js +++ b/src/layer/marker/Marker.Popup.js @@ -7,7 +7,9 @@ L.Marker.include({ if (this._popup && this._map && !this._map.hasLayer(this._popup)) { this._popup.setLatLng(this._latlng); this._map.openPopup(this._popup); - this._popup._closeButton.focus(); + if (this._popup.options.closeButton) { + this._popup._closeButton.focus(); + } } return this;