added display toggle method which will show/hide as necessary
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 23 Mar 2009 02:24:15 +0000 (02:24 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 23 Mar 2009 02:24:15 +0000 (02:24 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12642 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/Util.js

index 361d873..959b22e 100644 (file)
@@ -232,5 +232,16 @@ if(!dojo._hasResource["openils.Util"]) {
         dojo.style(node, 'visibility', 'visible');
     };
 
+    /** Toggles the display using show/hide, depending on the current value for CSS 'display' */
+    openils.Util.toggle = function(node) {
+        if(typeof node == 'string')
+            node = dojo.byId(node);
+        if(dojo.style(node, 'display') == 'none')
+            openils.Util.show(node);
+        else
+            openils.Util.hide(node);
+    };
+
+
 }