.attr('class', 'control-key');
var button = $('<a>')
- .attr('class', 'control-button mobile-hide')
+ .attr('class', 'control-button')
.attr('href', '#')
.html('<span class="icon key"></span>')
.on('click', toggle)
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() {
$('.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();