]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.layers.js
Merge remote-tracking branch 'upstream/pull/4304'
[rails.git] / app / assets / javascripts / leaflet.layers.js
index 2633d103794d6e6af8396545b49f7568be3900ae..27311f7c1441c3d22acde08cbcc526702b0e7e4e 100644 (file)
@@ -8,11 +8,12 @@ L.OSM.layers = function (options) {
       .attr("class", "section base-layers")
       .appendTo($ui);
 
       .attr("class", "section base-layers")
       .appendTo($ui);
 
-    var baseLayers = $("<ul class='list-unstyled'>")
+    var baseLayers = $("<ul class='list-unstyled mb-0'>")
       .appendTo(baseSection);
 
     layers.forEach(function (layer) {
       var item = $("<li>")
       .appendTo(baseSection);
 
     layers.forEach(function (layer) {
       var item = $("<li>")
+        .attr("class", "rounded-3")
         .appendTo(baseLayers);
 
       if (map.hasLayer(layer)) {
         .appendTo(baseLayers);
 
       if (map.hasLayer(layer)) {
@@ -98,11 +99,14 @@ L.OSM.layers = function (options) {
 
       var addOverlay = function (layer, name, maxArea) {
         var item = $("<li>")
 
       var addOverlay = function (layer, name, maxArea) {
         var item = $("<li>")
-          .tooltip({
-            placement: "top"
-          })
           .appendTo(overlays);
 
           .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);
         var label = $("<label>")
           .attr("class", "form-check-label")
           .appendTo(item);
@@ -144,9 +148,9 @@ L.OSM.layers = function (options) {
               .trigger("change");
           }
 
               .trigger("change");
           }
 
-          $(item).attr("class", disabled ? "disabled" : "");
-          item.attr("data-bs-original-title", disabled ?
-            I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip") : "");
+          $(item)
+            .attr("class", disabled ? "disabled" : "")
+            .tooltip(disabled ? "enable" : "disable");
         });
       };
 
         });
       };