]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.layers.js
Avoid running integration tests in every locale
[rails.git] / app / assets / javascripts / leaflet.layers.js
index d762696a18e556b4ffa5fb2548733ae9bd512251..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 ? // 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");
         });
       };
 
         });
       };