templates/resources/page.js
authorAlan Knowles <alan@akkbhome.com>
Thu, 25 Nov 2010 14:57:09 +0000 (22:57 +0800)
committerAlan Knowles <alan@akkbhome.com>
Thu, 25 Nov 2010 14:57:09 +0000 (22:57 +0800)
templates/resources/page.js

index 3d7c49c..9977a4e 100644 (file)
@@ -126,8 +126,18 @@ RooDocsPage = {
             
         } 
         return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name];
+    },
+    vis : '',
+    toggle : function()
+    {
+        this.vis = this.vis == '' ? 'none : '';
+        var vis = this.vis;
+        Array.prototype.slice.call(
+            document.getElementsByClassName('expandable')
+        ).forEach(function(e) { 
+            if (!e.className.match(/notInherited/)) { e.style.display= vis; }} 
+        )
     }
-    
 }