]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Enable some more eslint rules from iD rules
[rails.git] / app / assets / javascripts / index.js
index ccf4e561c98ceacd14d0e612f77e408fc6bac734..2678ba2824e3ad7edd05560a1a6bdd80324251d8 100644 (file)
 $(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 () {