]> git.openstreetmap.org Git - rails.git/blob - app/views/site/_sidebar.html.erb
Potlatch 2 compiled with Flex 4.5 requires Flash 10.2.0 or above
[rails.git] / app / views / site / _sidebar.html.erb
1 <div id="sidebar">
2   <table class="sidebar_title" width="100%">
3     <tr>
4       <td id="sidebar_title"><% t 'site.sidebar.search_results' %></td>
5       <td id="sidebar_close"><a href="javascript:closeSidebar()"><%= t 'site.sidebar.close' %></a></td>
6     </tr>
7   </table>
8   <div id="sidebar_content">
9   </div>
10 </div>
11
12 <script type="text/javascript">
13 <!--
14   var onclose;
15
16   function openSidebar(options) {
17     options = options || {};
18
19     if (onclose) {
20        onclose();
21        onclose = null;
22     }
23
24     if (options.title) { $("#sidebar_title").html(options.title); }
25
26     if (options.width) { $("#sidebar").width(options.width); }
27     else { $("#sidebar").width("30%"); }
28
29     $("#sidebar").css("display", "block");
30
31     <%= onopen %>
32
33     onclose = options.onclose;
34   }
35
36   function closeSidebar() {
37     $("#sidebar").css("display", "none");
38
39     <%= onclose %>
40
41     if (onclose) {
42        onclose();
43        onclose = null;
44     }
45   }
46
47   function updateSidebar(title, content) {
48     $("#sidebar_title").html(title);
49     $("#sidebar_content").html(content);
50   }
51 // -->
52 </script>