From e8f2af833ac73f953cb65d06b8861c0f9844e852 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 13 Sep 2022 04:20:57 +0300 Subject: [PATCH] Fix zoom level related tooltips for layer checkboxes --- app/assets/javascripts/leaflet.layers.js | 19 ++++++++++++++----- test/system/site_test.rb | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) 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 = $("