X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/05eba790089d8e70d3061cb07f6d40720aee6010..bf7b2cf38194380c56fbb419ced588a29c27f7b8:/app/assets/javascripts/sidebar.js?ds=sidebyside diff --git a/app/assets/javascripts/sidebar.js b/app/assets/javascripts/sidebar.js index 00ec299a1..912197b9f 100644 --- a/app/assets/javascripts/sidebar.js +++ b/app/assets/javascripts/sidebar.js @@ -5,18 +5,12 @@ function openSidebar(options) { 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"); -}; + $("#sidebar").width(options.width || "30%"); + $("#sidebar").css("display", "block").trigger("opened"); +} function closeSidebar() { - $("#sidebar").css("display", "none"); - - $("#sidebar").trigger("closed"); + $("#sidebar").css("display", "none").trigger("closed"); } $(document).ready(function () {