]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/search.js
Prevent empty search
[rails.git] / app / assets / javascripts / index / search.js
index fde4c249947a81e6e0f40b7dfac458b18cd98bd6..43142959b074d6c9586c238ea0bafc953e80063b 100644 (file)
@@ -49,13 +49,7 @@ OSM.Search = function(map) {
   page.pushstate = page.popstate = function(path) {
     var params = querystring.parse(path.substring(path.indexOf('?') + 1));
     $(".search_form input[name=query]").val(params.query);
-    map.invalidateSize();
-    $("#sidebar_content").load(path, function(a, b, xhr) {
-      if (xhr.getResponseHeader('X-Page-Title')) {
-        document.title = xhr.getResponseHeader('X-Page-Title');
-      }
-      page.load();
-    });
+    OSM.loadSidebarContent(path, page.load);
   };
 
   page.load = function() {