+//= require index/browse
+//= require index/export
+//= require index/key
+
$(document).ready(function () {
var marker;
var params = OSM.mapParams();
$("#exportanchor").click();
}
- var query;
- if (query = getArgs(window.location.toString()).query) {
- doSearch(query);
+ $("#search_form").submit(function () {
+ var extent = unproj(map.getExtent());
+
+ $("#sidebar_title").html(I18n.t('site.sidebar.search_results'));
+ $("#sidebar_content").load($(this).attr("action"), {
+ query: $("#query").val(),
+ minlon: extent.left,
+ minlat: extent.bottom,
+ maxlon: extent.right,
+ maxlat: extent.top
+ }, openSidebar);
+
+ return false;
+ });
+
+ if ($("#query").val()) {
+ $("#search_form").submit();
}
});