X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6dd34d8430f3ac92e59f5db8c0ad47b59d07e859..51d2a846ece990db7c4109ecf923ad9201c6f8e6:/app/assets/javascripts/leaflet.share.js?ds=sidebyside diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index 1dcf6ee65..0b868d2ca 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -10,7 +10,7 @@ L.OSM.share = function (options) { // Link / Embed var $linkSection = $("
") - .attr("class", "section share-link") + .attr("class", "share-link p-3 border-bottom border-secondary-subtle") .appendTo($ui); $("

") @@ -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"); @@ -96,13 +98,13 @@ L.OSM.share = function (options) { .on("click", select)) .append( $("

") - .attr("class", "text-muted") + .attr("class", "text-body-secondary") .text(I18n.t("javascripts.share.paste_html"))); // Geo URI var $geoUriSection = $("

") - .attr("class", "section share-geo-uri") + .attr("class", "share-geo-uri p-3 border-bottom border-secondary-subtle") .appendTo($ui); $("

") @@ -117,7 +119,7 @@ L.OSM.share = function (options) { // Image var $imageSection = $("
") - .attr("class", "section share-image") + .attr("class", "share-image p-3") .appendTo($ui); $("

") @@ -126,7 +128,7 @@ L.OSM.share = function (options) { $("
") .attr("id", "export-warning") - .attr("class", "text-muted") + .attr("class", "text-body-secondary") .text(I18n.t("javascripts.share.only_standard_layer")) .appendTo($imageSection); @@ -221,7 +223,7 @@ L.OSM.share = function (options) { }; $("

") - .attr("class", "text-muted") + .attr("class", "text-body-secondary") .html(I18n.t("javascripts.share.image_dimensions", args)) .appendTo($form); @@ -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(); }