X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/040804335d799bdcdff6005893c85daac3203f00..cdfe2ac21ec01344b4b10d566582e7cc2b2eb7cb:/app/assets/javascripts/index.js?ds=sidebyside diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 5cc3a25b8..2ed869905 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -234,11 +234,16 @@ $(document).ready(function () { var page = {}; page.pushstate = page.popstate = function(path) { - $("#sidebar").addClass("minimized"); + $("#content").addClass("overlay-sidebar"); map.invalidateSize(); $('#sidebar_content').load(path); }; + page.unload = function() { + $("#content").removeClass("overlay-sidebar"); + map.invalidateSize(); + }; + return page; }; @@ -246,16 +251,12 @@ $(document).ready(function () { var page = {}; page.pushstate = page.popstate = function(path, type, id) { - $("#sidebar").removeClass("minimized"); - map.invalidateSize(); $('#sidebar_content').load(path, function() { page.load(path, type, id); }); }; page.load = function(path, type, id) { - $("#sidebar").removeClass("minimized"); - if (OSM.STATUS === 'api_offline' || OSM.STATUS === 'database_offline') return; if (type === 'note') { @@ -302,17 +303,4 @@ $(document).ready(function () { map.getCenter().lat.toFixed(precision) + "," + map.getCenter().lng.toFixed(precision))); }); - - function removeSidebar() { - if ($(window).width() < 721) { - $('#sidebar').addClass("minimized"); - } - } - - $(window).resize(function() { - removeSidebar(); - }); - - removeSidebar(); - });