X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7ebaf34eb6a1efeba6dc08a80e2c892126bf5f7a..7ff77d9d3d7960ae993bf5ef97a66dbb10f2496e:/app/views/site/_resize.html.erb diff --git a/app/views/site/_resize.html.erb b/app/views/site/_resize.html.erb index f26e2248c..4b312bf8c 100644 --- a/app/views/site/_resize.html.erb +++ b/app/views/site/_resize.html.erb @@ -35,10 +35,7 @@ <% end -%> $("#map").width(content_width - sidebar_width - left_border - right_border); $("#map").height(content_height - top_border - bottom_border); - - <% if params[:controller] == "site" and params[:action] == "index" -%> - map.updateSize(); - <% end -%> + $("#map").trigger("resized"); } function handleResize() { @@ -48,4 +45,9 @@ resizeMap(); } + + $(document).ready(function () { + $("#sidebar").on("opened", resizeMap); + $("#sidebar").on("closed", resizeMap); + });