X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/582ab35ecd0b0cfacaedf8cbe1d6eadff302973b..9b2791fdd968a39c2d424f74a714ade96bc460a8:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 2f644e00a..d1adaeff3 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -24,15 +24,20 @@ $(document).ready(function () { map.hash = L.hash(map); - $(window).on('popstate', function() { - map.hash.update(); + $(window).on('popstate', function(e) { + // popstate is triggered when the hash changes as well as on actual navigation + // events. We want to update the hash on the latter and not the former. + if (e.originalEvent.state) { + map.hash.update(); + } }); var copyright = I18n.t('javascripts.map.copyright', {copyright_url: '/copyright'}); + var donate = I18n.t('javascripts.map.donate_link_text', {donate_url: 'http://donate.openstreetmap.org'}); var layers = [ new L.OSM.Mapnik({ - attribution: copyright, + attribution: copyright+" – "+donate, code: "M", keyid: "mapnik", name: I18n.t("javascripts.map.base.standard") @@ -309,7 +314,4 @@ $(document).ready(function () { map.getCenter().lng.toFixed(precision))); }); - $("#menu-icon").on("click", function() { - $("header").toggleClass("closed"); - }); });