From: Anton Khorev Date: Tue, 13 Sep 2022 01:20:57 +0000 (+0300) Subject: Fix zoom level related tooltips for layer checkboxes X-Git-Tag: live~1462^2~4 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e8f2af833ac73f953cb65d06b8861c0f9844e852 Fix zoom level related tooltips for layer checkboxes --- diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index d762696a1..f372b86cf 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -98,11 +98,15 @@ L.OSM.layers = function (options) { var addOverlay = function (layer, name, maxArea) { var item = $("
  • ") - .tooltip({ - placement: "top" - }) .appendTo(overlays); + var tooltip; + 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(); + } + var label = $("