]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/wclib.js
More compfort for inline vieweable attachments
[citadel.git] / webcit / static / wclib.js
index 01057a82b3672fed3c1509bbd8e5cc436220ae65..cf409d363c7a352599cdd6935f847f66c971902c 100644 (file)
@@ -47,6 +47,19 @@ function strcmp ( str1, str2 ) {
     return ( ( str1 == str2 ) ? 0 : ( ( str1 > str2 ) ? 1 : -1 ) );
 }
 
+
+
+function ToggleVisibility ($Which)
+{
+       if (document.getElementById)
+       {
+               if (document.getElementById($Which).style.display  == "none")
+                       document.getElementById($Which).style.display  = "inline";
+               else
+                       document.getElementById($Which).style.display  = "none";
+       }
+}
+
 function emptyElement(element) {
   childNodes = element.childNodes;
   for(var i=0; i<childNodes.length; i++) {
@@ -899,9 +912,8 @@ function switch_to_lang(new_lang) {
 
 function toggle_wholist() 
 {
-       d = $('online_users').style.display;
-
-       if (d == 'block') {
+       /* WARNING: VILE, SLEAZY HACK.  We determine the state of the box based on the image loaded. */
+       if ( $('expand_wholist').src.substring($('expand_wholist').src.length - 12) == "collapse.gif" ) {
                $('online_users').style.display = 'none';
                $('expand_wholist').src = 'static/expand.gif';
                wstate=0;