X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0ea6646fb6d86b11c78bc554168b76096fe21821..c47cb299a842a2eb7d022fcf4f0d02c08001f928:/app/assets/javascripts/leaflet.share.js diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index c72760c97..325b168b2 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -1,23 +1,24 @@ L.OSM.share = function (options) { - var control = L.OSM.sidebarPane(options, "share", "javascripts.share.title", "javascripts.share.title"), - marker = L.marker([0, 0], { draggable: true }), - locationFilter = new L.LocationFilter({ - enableButton: false, - adjustButton: false - }); + const control = L.OSM.sidebarPane(options, "share", "javascripts.share.title", "javascripts.share.title"), + marker = L.marker([0, 0], { draggable: true }), + locationFilter = new L.LocationFilter({ + enableButton: false, + adjustButton: false + }); control.onAddPane = function (map, button, $ui) { // Link / Embed + $("#content").addClass("overlay-right-sidebar"); - var $linkSection = $("
") - .attr("class", "section share-link") + const $linkSection = $("
") + .attr("class", "share-link p-3 border-bottom border-secondary-subtle") .appendTo($ui); $("

") .text(I18n.t("javascripts.share.link")) .appendTo($linkSection); - var $form = $("
") + let $form = $("") .appendTo($linkSection); $("
") @@ -46,11 +47,14 @@ L.OSM.share = function (options) { .text(I18n.t("javascripts.share.short_link"))) .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(); - var id = "#" + $(this).attr("for"); + if (!$(this).hasClass("btn-primary")) return; + const id = "#" + $(this).attr("for"); $(this).siblings("a") .removeClass("active"); $(this).addClass("active"); @@ -68,6 +72,8 @@ L.OSM.share = function (options) { .append($("") .attr("id", "long_input") .attr("type", "text") + .attr("class", "form-control form-control-sm font-monospace") + .attr("readonly", true) .on("click", select)); $("
") @@ -77,6 +83,8 @@ L.OSM.share = function (options) { .append($("") .attr("id", "short_input") .attr("type", "text") + .attr("class", "form-control form-control-sm font-monospace") + .attr("readonly", true) .on("click", select)); $("
") @@ -86,16 +94,18 @@ L.OSM.share = function (options) { .append( $("