]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.layers.js
Underline time elements that have a title
[rails.git] / app / assets / javascripts / leaflet.layers.js
index f372b86cfbe5819886b78726d9b87f9651fa1e5b..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)) {
@@ -100,11 +101,10 @@ L.OSM.layers = function (options) {
         var item = $("<li>")
           .appendTo(overlays);
 
         var item = $("<li>")
           .appendTo(overlays);
 
-        var tooltip;
         if (name === "notes" || name === "data") {
         if (name === "notes" || name === "data") {
-          item.attr("title", I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"));
-          tooltip = new bootstrap.Tooltip(item[0]);
-          tooltip.disable();
+          item
+            .attr("title", I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"))
+            .tooltip("disable");
         }
 
         var label = $("<label>")
         }
 
         var label = $("<label>")
@@ -148,14 +148,9 @@ L.OSM.layers = function (options) {
               .trigger("change");
           }
 
               .trigger("change");
           }
 
-          $(item).attr("class", disabled ? "disabled" : "");
-          if (tooltip) {
-            if (disabled) {
-              tooltip.enable();
-            } else {
-              tooltip.disable();
-            }
-          }
+          $(item)
+            .attr("class", disabled ? "disabled" : "")
+            .tooltip(disabled ? "enable" : "disable");
         });
       };
 
         });
       };