X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7503caa750f2788e2412e5b7f8ed37210b7407c3..4ac9ed6f1420531579ab9f19f282c3da1372ab4f:/app/assets/javascripts/leaflet.key.js?ds=inline diff --git a/app/assets/javascripts/leaflet.key.js b/app/assets/javascripts/leaflet.key.js index ea236a569..5223b1420 100644 --- a/app/assets/javascripts/leaflet.key.js +++ b/app/assets/javascripts/leaflet.key.js @@ -56,15 +56,17 @@ L.OSM.key = function (options) { if (!button.hasClass('disabled')) { options.sidebar.togglePane($ui, button); } + $('.leaflet-control .control-button').tooltip('hide'); } function updateButton() { - var disabled = map.getMapBaseLayerId() !== 'mapnik' + var disabled = ['mapnik', 'cyclemap'].indexOf(map.getMapBaseLayerId()) === -1; button .toggleClass('disabled', disabled) - .attr('data-original-title', I18n.t(disabled ? - 'javascripts.key.tooltip_disabled' : - 'javascripts.key.tooltip')) + .attr('data-original-title', + I18n.t(disabled ? + 'javascripts.key.tooltip_disabled' : + 'javascripts.key.tooltip')); } function update() { @@ -73,7 +75,7 @@ L.OSM.key = function (options) { $('.mapkey-table-entry').each(function () { var data = $(this).data(); - if (layer == data.layer && zoom >= data.zoomMin && zoom <= data.zoomMax) { + if (layer === data.layer && zoom >= data.zoomMin && zoom <= data.zoomMax) { $(this).show(); } else { $(this).hide();