]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_sidebar.rhtml
Migrate web site to use rails 2.0.1.
[rails.git] / app / views / site / _sidebar.rhtml
index 8cf1ce62c114f5828101147a3902a78999bcc21b..7addbe177a19fe40d100ce7f259480a187fe484f 100644 (file)
 <script type="text/javascript">
 <!--
   function openSidebar() {
-       if (arguments.length) { $("sidebar").style.width = arguments[0]; }
-                        else { $("sidebar").style.width = "30%"; }
+    if (arguments.length) { $("sidebar").style.width = arguments[0]; }
+    else { $("sidebar").style.width = "30%"; }
+
     $("sidebar").style.display = "block";
+
     <%= onopen %>
   }
 
   function closeSidebar() {
     $("sidebar").style.display = "none";
+
     <%= onclose %>
   }
 
     $("sidebar_title").innerHTML = title;
     $("sidebar_content").innerHTML = content;
   }
+
+  function sidebarOpen(title) {
+    return $("sidebar").style.display == "block" &&
+           $("sidebar_title").innerHTML == title;
+  }
 // -->
 </script>