]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Float the close icon, closes #40
[rails.git] / app / assets / javascripts / index.js
index c04e933ff3f09782ae1179081f3d612a2106f973..7c9d255bb955915a358726c3007021a6ebc03702 100644 (file)
@@ -37,7 +37,7 @@ $(document).ready(function () {
 
   var layers = [
     new L.OSM.Mapnik({
-      attribution: copyright + ' ' + donate,
+      attribution: copyright + " ♥ " + donate,
       code: "M",
       keyid: "mapnik",
       name: I18n.t("javascripts.map.base.standard")
@@ -103,10 +103,12 @@ $(document).ready(function () {
   map.dataLayer.options.code = 'D';
 
   if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
+    initializeNotes(map);
     if (params.layers.indexOf(map.noteLayer.options.code) >= 0) {
       map.addLayer(map.noteLayer);
     }
 
+    initializeBrowse(map);
     if (params.layers.indexOf(map.dataLayer.options.code) >= 0) {
       map.addLayer(map.dataLayer);
     }
@@ -227,31 +229,20 @@ $(document).ready(function () {
     });
   }
 
-  initializeBrowse(map);
-  initializeNotes(map);
-
   OSM.Index = function(map) {
-    var page = {}, minimized = false;
+    var page = {};
 
     page.pushstate = page.popstate = function(path) {
-      if (minimized) $("#sidebar").addClass("minimized");
+      $("#content").addClass("overlay-sidebar");
       map.invalidateSize();
-      $("#view_tab").addClass("current");
       $('#sidebar_content').load(path);
     };
 
     page.unload = function() {
-      $("#view_tab").removeClass("current");
-    };
-
-    page.minimizeSidebar = function() {
-      $("#sidebar").addClass("minimized");
+      $("#content").removeClass("overlay-sidebar");
       map.invalidateSize();
-      minimized = true;
     };
 
-    $(document).on("click", "#sidebar_content .close", page.minimizeSidebar);
-
     return page;
   };
 
@@ -259,8 +250,6 @@ $(document).ready(function () {
     var page = {};
 
     page.pushstate = page.popstate = function(path, type, id) {
-      $("#sidebar").removeClass("minimized");
-      map.invalidateSize();
       $('#sidebar_content').load(path, function() {
         page.load(path, type, id);
       });
@@ -313,5 +302,4 @@ $(document).ready(function () {
       map.getCenter().lat.toFixed(precision) + "," +
       map.getCenter().lng.toFixed(precision)));
   });
-
 });