X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2ef2d7c876168d6beb606b655470f48ffabc8841..5bb751ca26e72e8a342b06fbe453970f111e0c37:/app/assets/javascripts/edit.js diff --git a/app/assets/javascripts/edit.js b/app/assets/javascripts/edit.js index c2129e20c..7de65190e 100644 --- a/app/assets/javascripts/edit.js +++ b/app/assets/javascripts/edit.js @@ -1,41 +1,31 @@ function maximiseMap() { - $("#left").hide(); - $("#top-bar").hide(); - - $("#content").css("margin-top", "0px"); - if ($("html").attr("dir") == "ltr") { - $("#content").css("margin-left", "0px"); - } else { - $("#content").css("margin-right", "0px"); - } - - handleResize(); + $("#content").addClass("maximised"); } function minimiseMap() { - $("#left").show(); - $("#top-bar").show(); - - $("#content").css("margin-top", "30px"); - if ($("html").attr("dir") == "ltr") { - $("#content").css("margin-left", "185px"); - } else { - $("#content").css("margin-right", "185px"); - } - - handleResize(); + $("#content").removeClass("maximised"); } $(document).ready(function () { - $(window).resize(handleResize); - handleResize(); + $("#search_form").submit(function (e) { + e.preventDefault(); - $("#search_form").submit(function () { $("#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(); - return false; + var mapParams = OSM.mapParams(); + + $("#sidebar_title").html(I18n.t('site.sidebar.search_results')); + $("#sidebar_content").load($(this).attr("href"), { + lat: mapParams.lat, + lon: mapParams.lon, + zoom: mapParams.zoom + }, openSidebar); }); });