Clean up search JS

Move it to index.js/edit.js and eliminate the global doSearch
function. Not enough code is shared to justify it.
This commit is contained in:
John Firebaugh 2012-09-29 10:01:29 -07:00 committed by Tom Hughes
parent e83d43ca82
commit 605c700895
4 changed files with 32 additions and 34 deletions

View file

@ -28,5 +28,16 @@ function minimiseMap() {
handleResize();
}
$(document).ready(handleResize);
$(window).resize(handleResize);
$(document).ready(function () {
$(window).resize(handleResize);
handleResize();
$("#search_form").submit(function () {
$("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
$("#sidebar_content").load($(this).attr("action"), {
query: $("#query").val()
}, openSidebar);
return false;
});
});