]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.layers.js
Add user home location change listeners and buttons
[rails.git] / app / assets / javascripts / leaflet.layers.js
index d762696a18e556b4ffa5fb2548733ae9bd512251..020876c470c71f134ab5e2543e29a73be8c7b7b8 100644 (file)
@@ -98,11 +98,14 @@ L.OSM.layers = function (options) {
 
       var addOverlay = function (layer, name, maxArea) {
         var item = $("<li>")
-          .tooltip({
-            placement: "top"
-          })
           .appendTo(overlays);
 
+        if (name === "notes" || name === "data") {
+          item
+            .attr("title", I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"))
+            .tooltip("disable");
+        }
+
         var label = $("<label>")
           .attr("class", "form-check-label")
           .appendTo(item);
@@ -144,9 +147,9 @@ L.OSM.layers = function (options) {
               .trigger("change");
           }
 
-          $(item).attr("class", disabled ? "disabled" : "");
-          item.attr("data-bs-original-title", disabled ? // has additional bug when zooming out from enabled state
-            I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip") : "");
+          $(item)
+            .attr("class", disabled ? "disabled" : "")
+            .tooltip(disabled ? "enable" : "disable");
         });
       };