X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bab796bc7eb0b44eeb15d6fee567440647bc57e0..7094370208712e77d92ea2ad0d76e160742d6c0a:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 171c42783..cb670da34 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -16,7 +16,6 @@ //= require menu //= require sidebar //= require richtext -//= require resize //= require geocoder //= require querystring @@ -100,25 +99,26 @@ function updatelinks(loc, zoom, layers, bounds, object) { var minzoom = $(link).data("minzoom"); if (minzoom) { - var name = link.id.replace(/anchor$/, ""); - $(link).off("click.minzoom"); - if (zoom >= minzoom) { - $(link).attr("title", I18n.t("javascripts.site." + name + "_tooltip")) - .removeClass("disabled"); - } else { - $(link).on("click.minzoom", minZoomAlert) - .attr("title", I18n.t("javascripts.site." + name + "_disabled_tooltip")) - .addClass("disabled"); - } + var name = link.id.replace(/anchor$/, ""); + $(link).off("click.minzoom"); + if (zoom >= minzoom) { + $(link) + .attr("title", I18n.t("javascripts.site." + name + "_tooltip")) + .removeClass("disabled"); + } else { + $(link) + .attr("title", I18n.t("javascripts.site." + name + "_disabled_tooltip")) + .addClass("disabled") + .on("click.minzoom", function () { + alert(I18n.t("javascripts.site." + name + "_zoom_alert")); + return false; + }); + } } link.href = base + '?' + querystring.stringify(args); } } -function minZoomAlert() { - alert(I18n.t("javascripts.site." + name + "_zoom_alert")); return false; -} - function getShortUrl(map) { return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ? 'http://osm.org/go/' : 'http://' + window.location.hostname + '/go/') +