From: John Firebaugh Date: Wed, 12 Jun 2013 19:29:19 +0000 (-0700) Subject: Fix locate button style X-Git-Tag: live~5463^2~30 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/74293c89468019254b2b5b298b8fae9d7abfc78b Fix locate button style --- diff --git a/vendor/assets/leaflet/leaflet.locate.js b/vendor/assets/leaflet/leaflet.locate.js index be5c7fc01..77754d84d 100644 --- a/vendor/assets/leaflet/leaflet.locate.js +++ b/vendor/assets/leaflet/leaflet.locate.js @@ -74,7 +74,7 @@ L.Control.Locate = L.Control.extend({ } self._active = true; if (!self._event) { - self._container.className = className + " requesting"; + L.DomUtil.addClass(self._container, "requesting"); } else { visualizeLocation(); } @@ -137,7 +137,9 @@ L.Control.Locate = L.Control.extend({ if (!self._container) return; - self._container.className = className + " active"; + + L.DomUtil.removeClass(self._container, "requesting"); + L.DomUtil.addClass(self._container, "active"); }; var resetVariables = function() { @@ -151,7 +153,9 @@ L.Control.Locate = L.Control.extend({ _log('stopLocate'); map.stopLocate(); - self._container.className = className; + L.DomUtil.removeClass(self._container, "requesting"); + L.DomUtil.removeClass(self._container, "active"); + resetVariables(); self._layer.clearLayers();