X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6dd34d8430f3ac92e59f5db8c0ad47b59d07e859..9c3ab20fbafeb6f69da9b38a5d41c0173038668e:/app/assets/javascripts/leaflet.share.js?ds=inline diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index 1dcf6ee65..eb351fa02 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -47,10 +47,12 @@ L.OSM.share = function (options) { .append($("") .attr("for", "embed_html") .attr("id", "embed_link") + .attr("data-bs-title", I18n.t("javascripts.site.embed_html_disabled")) .attr("href", "#") .text(I18n.t("javascripts.share.embed"))) .on("click", "a", function (e) { e.preventDefault(); + if (!$(this).hasClass("btn-primary")) return; var id = "#" + $(this).attr("for"); $(this).siblings("a") .removeClass("active"); @@ -336,7 +338,10 @@ L.OSM.share = function (options) { params.marker = latLng.lat + "," + latLng.lng; } - $("#embed_link").toggleClass("disabled", !canEmbed); + $("#embed_link") + .toggleClass("btn-primary", canEmbed) + .toggleClass("btn-secondary", !canEmbed) + .tooltip(canEmbed ? "disable" : "enable"); if (!canEmbed && $("#embed_link").hasClass("active")) { $("#long_link").click(); }