]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/edit.js
Sidebar work
[rails.git] / app / assets / javascripts / edit.js
index c2129e20c170a8a91470fb9c1f7390fcc7ca3f1a..b03b71154e1a6b3248ecc2dac14c926132a92d21 100644 (file)
@@ -1,41 +1,29 @@
 function maximiseMap() {
-  $("#left").hide();
-  $("#top-bar").hide();
-
-  $("#content").css("margin-top", "0px");
-  if ($("html").attr("dir") == "ltr") {
-    $("#content").css("margin-left", "0px");
-  } else {
-    $("#content").css("margin-right", "0px");
-  }
-
-  handleResize();
+  $("#content").addClass("maximised");
 }
 
 function minimiseMap() {
-  $("#left").show();
-  $("#top-bar").show();
-
-  $("#content").css("margin-top", "30px");
-  if ($("html").attr("dir") == "ltr") {
-    $("#content").css("margin-left", "185px");
-  } else {
-    $("#content").css("margin-right", "185px");
-  }
-
-  handleResize();
+  $("#content").removeClass("maximised");
 }
 
 $(document).ready(function () {
-  $(window).resize(handleResize);
-  handleResize();
+  $("#search_form").submit(function (e) {
+    e.preventDefault();
 
-  $("#search_form").submit(function () {
-    $("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
     $("#sidebar_content").load($(this).attr("action"), {
       query: $("#query").val()
-    }, openSidebar);
+    });
+  });
+
+  $("#describe_location").click(function (e) {
+    e.preventDefault();
+
+    var mapParams = OSM.mapParams();
 
-    return false;
+    $("#sidebar_content").load($(this).attr("href"), {
+      lat: mapParams.lat,
+      lon: mapParams.lon,
+      zoom: mapParams.zoom
+    });
   });
 });