]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_sidebar.rhtml
Remove old code to exit after 10000 requests as the memory limit code
[rails.git] / app / views / site / _sidebar.rhtml
index 7addbe177a19fe40d100ce7f259480a187fe484f..ad2845ff47ed8a637f6079e9fbf3ff31017a2124 100644 (file)
 
 <script type="text/javascript">
 <!--
-  function openSidebar() {
-    if (arguments.length) { $("sidebar").style.width = arguments[0]; }
+  var onclose;
+
+  function openSidebar(options) {
+    options = options || {};
+
+    if (onclose) {
+       onclose();
+       onclose = null;
+    }
+
+    if (options.width) { $("sidebar").style.width = options.width; }
     else { $("sidebar").style.width = "30%"; }
 
     $("sidebar").style.display = "block";
 
     <%= onopen %>
+
+    onclose = options.onclose;
   }
 
   function closeSidebar() {
     $("sidebar").style.display = "none";
 
     <%= onclose %>
+
+    if (onclose) {
+       onclose();
+       onclose = null;
+    }
   }
 
   function updateSidebar(title, content) {