]> git.openstreetmap.org Git - rails.git/blob - app/views/site/_sidebar.html.erb
Add methods to get a bug's author details from the first comment
[rails.git] / app / views / site / _sidebar.html.erb
1 <div id="sidebar">
2   <table class="sidebar_title" width="100%">
3     <tr>
4       <td align="left" id="sidebar_title"><% t 'site.sidebar.search_results' %></td>
5       <td align="right"><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").innerHTML = options.title; }
25
26     if (options.width) { $("sidebar").style.width = options.width; }
27     else { $("sidebar").style.width = "30%"; }
28
29     $("sidebar").style.display = "block";
30
31     <%= onopen %>
32
33     onclose = options.onclose;
34   }
35
36   function closeSidebar() {
37     $("sidebar").style.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").innerHTML = title;
49     $("sidebar_content").innerHTML = content;
50   }
51 // -->
52 </script>