]> code.citadel.org Git - citadel.git/blob - webcit/static/menuExpandable3.js
* "folders view" of room list now uses Dave Lindquist's "menuExpandable3"
[citadel.git] / webcit / static / menuExpandable3.js
1 /*
2  * menuExpandable3.js - implements an expandable menu based on a HTML list
3  * Author: Dave Lindquist (http://www.gazingus.org)
4  */
5
6 if (!document.getElementById)
7     document.getElementById = function() { return null; }
8
9 function initializeMenu(menuId, actuatorId) {
10     var menu = document.getElementById(menuId);
11     var actuator = document.getElementById(actuatorId);
12
13     if (menu == null || actuator == null) return;
14
15     //if (window.opera) return; // I'm too tired
16
17     actuator.parentNode.style.backgroundImage = "url(/static/plus.gif)";
18     actuator.onclick = function() {
19         var display = menu.style.display;
20         this.parentNode.style.backgroundImage =
21             (display == "block") ? "url(/static/plus.gif)" : "url(/static/minus.gif)";
22         menu.style.display = (display == "block") ? "none" : "block";
23
24         return false;
25     }
26 }
27
28
29