X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/857e9179b870203f1411bb6f9599ab676b77d5cf..1e9603c7b1eed068d5c18d98d4505e1c6a764f81:/app/assets/javascripts/leaflet.key.js diff --git a/app/assets/javascripts/leaflet.key.js b/app/assets/javascripts/leaflet.key.js index bcd5839cd..f89ae0c3d 100644 --- a/app/assets/javascripts/leaflet.key.js +++ b/app/assets/javascripts/leaflet.key.js @@ -3,7 +3,7 @@ L.OSM.key = function (options) { control.onAddPane = function (map, button, $ui) { var $section = $("
") - .attr("class", "section") + .attr("class", "p-3") .appendTo($ui); $ui @@ -39,11 +39,11 @@ L.OSM.key = function (options) { $(".mapkey-table-entry").each(function () { var data = $(this).data(); - if (layer === data.layer && zoom >= data.zoomMin && zoom <= data.zoomMax) { - $(this).show(); - } else { - $(this).hide(); - } + $(this).toggle( + layer === data.layer && + (!data.zoomMin || zoom >= data.zoomMin) && + (!data.zoomMax || zoom <= data.zoomMax) + ); }); } };