]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Redo mobile styles
[rails.git] / app / assets / javascripts / index.js
index 8a17767140864c96d9bbc4b8e9f893d8e0d91cf5..2ed869905995753fecea8b6515c4f72ed63414cc 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")
@@ -231,14 +231,19 @@ $(document).ready(function () {
   initializeNotes(map);
 
   OSM.Index = function(map) {
-    var page = {}, minimized = $('#sidebar').hasClass('minimized');
+    var page = {};
 
     page.pushstate = page.popstate = function(path) {
-      if (minimized) $("#sidebar").addClass("minimized");
+      $("#content").addClass("overlay-sidebar");
       map.invalidateSize();
       $('#sidebar_content').load(path);
     };
 
+    page.unload = function() {
+      $("#content").removeClass("overlay-sidebar");
+      map.invalidateSize();
+    };
+
     return page;
   };
 
@@ -246,8 +251,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);
       });
@@ -300,5 +303,4 @@ $(document).ready(function () {
       map.getCenter().lat.toFixed(precision) + "," +
       map.getCenter().lng.toFixed(precision)));
   });
-
 });