]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/search.js
Sidebar work
[rails.git] / app / assets / javascripts / index / search.js
index 2f92e6282ec45fa49f13e3f4bd0e9bd4d8577428..ce00fa0afff8c74600f757be2732e80288936253 100644 (file)
@@ -21,17 +21,15 @@ function initializeSearch(map) {
 
     var bounds = map.getBounds();
 
-    $("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
     $("#sidebar_content").load($(this).attr("action"), {
       query: $("#query").val(),
+      zoom: map.getZoom(),
       minlon: bounds.getWest(),
       minlat: bounds.getSouth(),
       maxlon: bounds.getEast(),
       maxlat: bounds.getNorth()
     });
 
-    openSidebar();
-
     $("#sidebar").one("closed", function () {
       map.removeLayer(marker);
       map.removeObject();
@@ -66,11 +64,10 @@ function initializeSearch(map) {
     var center = map.getCenter(),
       zoom = map.getZoom();
 
-    $("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
     $("#sidebar_content").load($(this).attr("href"), {
       lat: center.lat,
       lon: center.lng,
       zoom: zoom
-    }, openSidebar);    
+    });
   }
 }