X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4d91fe3dd95c1058cb8d24fd4c900223e30b9059..53e4d600e712dea988028a12f68927c3400a6901:/app/assets/javascripts/sidebar.js diff --git a/app/assets/javascripts/sidebar.js b/app/assets/javascripts/sidebar.js index a5d906980..21a4380dc 100644 --- a/app/assets/javascripts/sidebar.js +++ b/app/assets/javascripts/sidebar.js @@ -1,24 +1,11 @@ -function openSidebar(options) { - options = options || {}; - - $("#sidebar").trigger("closed"); - - if (options.title) { $("#sidebar_title").html(options.title); } - - if (options.width) { $("#sidebar").width(options.width); } - else { $("#sidebar").width("30%"); } - - $("#sidebar").css("display", "block"); - - $("#sidebar").trigger("opened"); -}; +function closeSidebar() { + $("#sidebar") + .trigger("closed"); +} $(document).ready(function () { $(".sidebar_close").click(function (e) { - $("#sidebar").css("display", "none"); - - $("#sidebar").trigger("closed"); - + closeSidebar(); e.preventDefault(); }); });