- if ($ui.is(':visible')) {
- $(options.uiPane).hide();
- controlContainer.css({paddingRight: '0'});
- map.off("zoomend baselayerchange", update);
- } else {
- $(options.uiPane).show();
- controlContainer.css({paddingRight: '200px'});
- map.on("zoomend baselayerchange", update);
- $section.load('/key', update);
- }
+ function updateButton() {
+ var disabled = ["mapnik", "cyclemap"].indexOf(map.getMapBaseLayerId()) === -1;
+ button
+ .toggleClass("disabled", disabled)
+ .attr("data-bs-original-title",
+ I18n.t(disabled ?
+ "javascripts.key.tooltip_disabled" :
+ "javascripts.key.tooltip"));