X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bc27347b8f8333b65962b8c00f76dc99a1095a8a..effb1b7f4170bb7244c4dfffcbe6134fe00e2bc4:/app/assets/javascripts/leaflet.key.js 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();