X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/54ded37bf2e9967f6462795eebf0b5117399391a..ffeddd62a8c090c43074596f3095e21e5b7f3e5e:/app/assets/javascripts/leaflet.note.js diff --git a/app/assets/javascripts/leaflet.note.js b/app/assets/javascripts/leaflet.note.js index c0f72af20..8451e9b72 100644 --- a/app/assets/javascripts/leaflet.note.js +++ b/app/assets/javascripts/leaflet.note.js @@ -13,10 +13,8 @@ L.OSM.note = function (options) { map.on('zoomend', update); - update(); - function update() { - var disabled = map.getZoom() < 12; + var disabled = OSM.STATUS === "database_offline" || map.getZoom() < 12; link .toggleClass('disabled', disabled) .attr('data-original-title', I18n.t(disabled ? @@ -24,6 +22,8 @@ L.OSM.note = function (options) { 'javascripts.site.createnote_tooltip')); } + update(); + return $container[0]; };