X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/89a132d31c8ca3b446c716860e55bf31bc811bd0..50f85248db5a2bf1ca860d864f20772f1b87c3d1:/app/assets/javascripts/leaflet.key.js diff --git a/app/assets/javascripts/leaflet.key.js b/app/assets/javascripts/leaflet.key.js index 3f71932fb..5223b1420 100644 --- a/app/assets/javascripts/leaflet.key.js +++ b/app/assets/javascripts/leaflet.key.js @@ -6,7 +6,7 @@ L.OSM.key = function (options) { .attr('class', 'control-key'); var button = $('') - .attr('class', 'control-button mobile-hide') + .attr('class', 'control-button') .attr('href', '#') .html('') .on('click', toggle) @@ -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();