]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Redo mobile styles
[rails.git] / app / assets / javascripts / index.js
index 7ed89681e01749c7483652bba5b1629baa04cf27..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,16 +251,12 @@ $(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);
       });
     };
 
     page.load = function(path, type, id) {
-      $("#sidebar").removeClass("minimized");
-
       if (OSM.STATUS === 'api_offline' || OSM.STATUS === 'database_offline') return;
 
       if (type === 'note') {
@@ -302,17 +303,4 @@ $(document).ready(function () {
       map.getCenter().lat.toFixed(precision) + "," +
       map.getCenter().lng.toFixed(precision)));
   });
-
-  function removeSidebar() {
-    if ($(window).width() < 721) {
-      $('#sidebar').addClass("minimized");
-    }
-  }
-
-  $(window).resize(function() {
-    removeSidebar();
-  });
-
-  removeSidebar();
-
 });