X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/05eba790089d8e70d3061cb07f6d40720aee6010..6453310d4dc095c670fb3431e15c3c05639716c9:/app/assets/javascripts/sidebar.js 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 () {