X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0a046673d630a4618c27559875ce613465d85d3c..d3ab0c9a8a01161a5f701e3fafbc16d08716dd40:/app/assets/javascripts/leaflet.share.js diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index c096a92fc..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", "text-muted") + .attr("class", "text-body-secondary") .text(I18n.t("javascripts.share.paste_html"))); // Geo URI var $geoUriSection = $("
") - .attr("class", "text-muted") + .attr("class", "text-body-secondary") .html(I18n.t("javascripts.share.image_dimensions", args)) .appendTo($form); @@ -309,6 +312,7 @@ L.OSM.share = function (options) { } function update() { + var canEmbed = map.getMapBaseLayerId() !== "tracestracktopo"; var bounds = map.getBounds(); $("#link_marker") @@ -334,6 +338,14 @@ L.OSM.share = function (options) { params.marker = latLng.lat + "," + latLng.lng; } + $("#embed_link") + .toggleClass("btn-primary", canEmbed) + .toggleClass("btn-secondary", !canEmbed) + .tooltip(canEmbed ? "disable" : "enable"); + if (!canEmbed && $("#embed_link").hasClass("active")) { + $("#long_link").click(); + } + $("#embed_html").val( "