]> git.openstreetmap.org Git - rails.git/blob - app/assets/javascripts/sidebar.js
Move "Browse Map Data" to layers control
[rails.git] / app / assets / javascripts / sidebar.js
1 function openSidebar(options) {
2   options = options || {};
3
4   $("#sidebar").trigger("closed");
5
6   if (options.title) { $("#sidebar_title").html(options.title); }
7
8   if (options.width) { $("#sidebar").width(options.width); }
9   else { $("#sidebar").width("30%"); }
10
11   $("#sidebar").css("display", "block");
12
13   $("#sidebar").trigger("opened");
14 };
15
16 function closeSidebar() {
17   $("#sidebar").css("display", "none");
18
19   $("#sidebar").trigger("closed");
20 }
21
22 $(document).ready(function () {
23   $(".sidebar_close").click(function (e) {
24     closeSidebar();
25     e.preventDefault();
26   });
27 });