]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/user.js
Move leaflet.locatecontrol to be a yarn managed asset
[rails.git] / app / assets / javascripts / user.js
index 69cc259f0c9e0195ecf5157ebb8d20d3e7703cac..3bdb35470c24320c21c8e6f276bf41c082f88d7a 100644 (file)
@@ -1,4 +1,4 @@
-//= require leaflet.locate
+//= require leaflet.locatecontrol/src/L.Control.Locate
 
 $(document).ready(function () {
   if ($("#map").length) {
@@ -18,7 +18,9 @@ $(document).ready(function () {
       iconLoading: "icon geolocate",
       strings: {
         title: I18n.t("javascripts.map.locate.title"),
-        popup: I18n.t("javascripts.map.locate.popup")
+        popup: function (options) {
+          return I18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
+        }
       }
     }).addTo(map);
 
@@ -85,8 +87,8 @@ $(document).ready(function () {
 
   $("select#user_auth_provider").on("change", updateAuthUID);
 
-  $("input#user_image").on("change", function () {
-    $("#image_action_new").prop("checked", true);
+  $("input#user_avatar").on("change", function () {
+    $("#avatar_action_new").prop("checked", true);
   });
 
   function enableAuth() {