X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/815c98c977831a9a7f84dca49186f5eea7b4a283..e338d1140884bb2bf3ed1b8fc85c890d0937ef8c:/app/assets/javascripts/key.js diff --git a/app/assets/javascripts/key.js b/app/assets/javascripts/key.js index daff6eee6..1e4138b70 100644 --- a/app/assets/javascripts/key.js +++ b/app/assets/javascripts/key.js @@ -8,12 +8,10 @@ $(document).ready(function () { mapZoom = map.getZoom(); $(".mapkey-table-entry").each(function () { - var entryLayer = $(this).attr("data-layer"), - entryZoomMin = parseInt($(this).attr("data-zoom-min")), - entryZoomMax = parseInt($(this).attr("data-zoom-max")); + var data = $(this).data(); - if (mapLayer == entryLayer && - mapZoom >= entryZoomMin && mapZoom <= entryZoomMax) { + if (mapLayer == data.layer && + mapZoom >= data.zoomMin && mapZoom <= data.zoomMax) { $(this).show(); } else { $(this).hide();