X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/34e251c225c7903b64f1fda2b594dd1c70aeeb93..aaeca5b5346b01d7ef26a301492804d36049eff8:/app/assets/javascripts/leaflet.key.js diff --git a/app/assets/javascripts/leaflet.key.js b/app/assets/javascripts/leaflet.key.js index d88ce5d6e..cc86736ef 100644 --- a/app/assets/javascripts/leaflet.key.js +++ b/app/assets/javascripts/leaflet.key.js @@ -8,7 +8,6 @@ L.OSM.key = function (options) { var button = $('') .attr('class', 'control-button') .attr('href', '#') - .attr('title', I18n.t('javascripts.key.tooltip')) .html('') .on('click', toggle) .appendTo($container); @@ -61,8 +60,12 @@ L.OSM.key = function (options) { } function updateButton() { - var layer = map.getMapBaseLayerId(); - button.toggleClass('disabled', layer !== 'mapnik'); + var disabled = map.getMapBaseLayerId() !== 'mapnik' + button + .toggleClass('disabled', disabled) + .attr('data-original-title', I18n.t(disabled ? + 'javascripts.key.tooltip_disabled' : + 'javascripts.key.tooltip')) } function update() {