]> git.openstreetmap.org Git - rails.git/commitdiff
Fix locate button style
authorJohn Firebaugh <john.firebaugh@gmail.com>
Wed, 12 Jun 2013 19:29:19 +0000 (12:29 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 18 Jul 2013 17:45:14 +0000 (10:45 -0700)
vendor/assets/leaflet/leaflet.locate.js

index be5c7fc01c95c6129f68e85c0912c91745fb504e..77754d84d14c6c16e452cff070da679dfcc5a74e 100644 (file)
@@ -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();