X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/d3700e6201b4b78a70bbb2941572edc985b63c2c..87127d41e95380236ba7652b14a86059ff6eeedc:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index ccf4e561c..2678ba282 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -25,6 +25,12 @@ $(document).ready(function () { var loaderTimeout; + var map = new L.OSM.Map("map", { + zoomControl: false, + layerControl: false, + contextmenu: true + }); + OSM.loadSidebarContent = function(path, callback) { map.setSidebarOverlaid(false); @@ -78,12 +84,6 @@ $(document).ready(function () { var params = OSM.mapParams(); - var map = new L.OSM.Map("map", { - zoomControl: false, - layerControl: false, - contextmenu: true - }); - map.attributionControl.setPrefix(''); map.updateLayers(params.layers); @@ -187,12 +187,12 @@ $(document).ready(function () { $.cookie('_osm_location', OSM.locationCookie(map), { expires: expiry, path: '/' }); }); - if ($.cookie('_osm_welcome') === 'hide') { - $('.welcome').hide(); + if ($.cookie('_osm_welcome') !== 'hide') { + $('.welcome').addClass('visible'); } $('.welcome .close-wrap').on('click', function() { - $('.welcome').hide(); + $('.welcome').removeClass('visible'); $.cookie('_osm_welcome', 'hide', { expires: expiry, path: '/' }); }); @@ -334,7 +334,7 @@ $(document).ready(function () { }; function addObject(type, id, center) { - map.addObject({type: type, id: parseInt(id)}, function(bounds) { + map.addObject({type: type, id: parseInt(id, 10)}, function(bounds) { if (!window.location.hash && bounds.isValid() && (center || !map.getBounds().contains(bounds))) { OSM.router.withoutMoveListener(function () {