]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.layers.js
Allow moderator to unhide diary entries as well as hide them
[rails.git] / app / assets / javascripts / leaflet.layers.js
index 2633d103794d6e6af8396545b49f7568be3900ae..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 ?
-            I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip") : "");
+          $(item)
+            .attr("class", disabled ? "disabled" : "")
+            .tooltip(disabled ? "enable" : "disable");
         });
       };