]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/edit.js
Fix "where am I" on the edit page
[rails.git] / app / assets / javascripts / edit.js
index f5ada1508ccfc4c7879d76f337da4fc8eb844e30..642aa9bda11ba5d630dfeb7c814ca545971ed5a5 100644 (file)
@@ -1,32 +1,31 @@
 function maximiseMap() {
-  $("#left").hide();
-  $("#greeting").hide();
-  $("#tabnav").hide();
-
-  $("#content").css("top", "0px");
-  if ($("html").attr("dir") == "ltr") {
-    $("#content").css("left", "0px");
-  } else {
-    $("#content").css("right", "0px");
-  }
-
-  handleResize();
+  $("#content").addClass("maximised");
 }
 
 function minimiseMap() {
-  $("#left").show();
-  $("#greeting").show();
-  $("#tabnav").show();
+  $("#content").removeClass("maximised");
+}
 
-  $("#content").css("top", "30px");
-  if ($("html").attr("dir") == "ltr") {
-    $("#content").css("left", "185px");
-  } else {
-    $("#content").css("right", "185px");
-  }
+$(document).ready(function () {
+  $("#search_form").submit(function (e) {
+    e.preventDefault();
 
-  handleResize();
-}
+    $("#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();
 
-$(document).ready(handleResize);
-$(window).resize(handleResize);
+    $("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
+    $("#sidebar_content").load($(this).attr("href"), {
+      lat: mapParams.lat,
+      lon: mapParams.lng,
+      zoom: mapParams.zoom
+    }, openSidebar);    
+  });
+});