]> git.openstreetmap.org Git - rails.git/blob - app/views/site/_sidebar.rhtml
Merge 7296:7427 from export branch to trunk.
[rails.git] / app / views / site / _sidebar.rhtml
1 <div id="sidebar">
2   <table class="sidebar_title" width="100%">
3     <tr>
4       <td align="left" id="sidebar_title">Search Results</td>
5       <td align="right"><a href="javascript:closeSidebar()">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     if (onclose) {
18        onclose();
19        onclose = null;
20     }
21
22     if (options.width) { $("sidebar").style.width = options.width; }
23     else { $("sidebar").style.width = "30%"; }
24
25     $("sidebar").style.display = "block";
26
27     <%= onopen %>
28
29     onclose = options.onclose;
30   }
31
32   function closeSidebar() {
33     $("sidebar").style.display = "none";
34
35     <%= onclose %>
36
37     if (onclose) {
38        onclose();
39        onclose = null;
40     }
41   }
42
43   function updateSidebar(title, content) {
44     $("sidebar_title").innerHTML = title;
45     $("sidebar_content").innerHTML = content;
46   }
47
48   function sidebarOpen(title) {
49     return $("sidebar").style.display == "block" &&
50            $("sidebar_title").innerHTML == title;
51   }
52 // -->
53 </script>