From: Anton Khorev Date: Sat, 27 Aug 2022 17:33:44 +0000 (+0300) Subject: Create Leaflet sidebar pane control with header writer fn X-Git-Tag: live~1620^2~7 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/8a02bd67d9d20c4a6b01b58e88b8d65163a3798e?hp=cd5b793dca4356aa039fddfc01193ba6744e057f Create Leaflet sidebar pane control with header writer fn --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 40f546009..5ba36a455 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -1,5 +1,6 @@ //= require_self //= require leaflet.sidebar +//= require leaflet.sidebar-pane //= require leaflet.locatecontrol/src/L.Control.Locate //= require leaflet.layers //= require leaflet.key diff --git a/app/assets/javascripts/leaflet.key.js b/app/assets/javascripts/leaflet.key.js index 367c39c14..46c4661d2 100644 --- a/app/assets/javascripts/leaflet.key.js +++ b/app/assets/javascripts/leaflet.key.js @@ -1,5 +1,5 @@ L.OSM.key = function (options) { - var control = L.control(options); + var control = L.OSM.sidebarPane(options); control.onAdd = function (map) { var $container = $("
") @@ -12,19 +12,7 @@ L.OSM.key = function (options) { .on("click", toggle) .appendTo($container); - var $ui = $("
") - .attr("class", "key-ui"); - - $("
") - .attr("class", "sidebar_heading") - .appendTo($ui) - .append( - $("