svn commit: r665828 - /ofbiz/trunk/framework/images/webapp/images/selectall.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r665828 - /ofbiz/trunk/framework/images/webapp/images/selectall.js

apatel-2
Author: apatel
Date: Mon Jun  9 11:56:54 2008
New Revision: 665828

URL: http://svn.apache.org/viewvc?rev=665828&view=rev
Log:
Added support for Collapseable Panel. Now All the Panels rendered using screenlet screen widget are collapseable using Effects library and not server round trip if javascript is enabled.

Modified:
    ofbiz/trunk/framework/images/webapp/images/selectall.js

Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=665828&r1=665827&r2=665828&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/selectall.js Mon Jun  9 11:56:54 2008
@@ -299,6 +299,34 @@
         new Ajax.Autocompleter($(areaArray[i]), optionsDivId, areaArray[i + 1], {parameters: areaArray[i + 2]});
     }
 }
+
+Event.observe(window,'load', function() {
+    var collapseablePanels = $$('li.collapsed', 'li.expanded');
+    collapseablePanels.each( function(e) {
+      if(e){
+          atag = e.down('a');
+          atag.observe('click', toggleCollapsablePanel);
+      }
+  });    
+
+});
+
+function toggleCollapsablePanel(event){
+ var atag = event.element();
+ titleDiv = atag.up('div.screenlet-title-bar');
+ bodyDiv = titleDiv.next();
+    liElement = atag.up('li');
+    if(bodyDiv.visible()){
+        liElement.removeClassName('expanded');
+        liElement.addClassName('collapsed');
+    } else {
+        liElement.removeClassName('collapsed');
+     liElement.addClassName('expanded');
+    
+    }
+ Effect.toggle(bodyDiv, 'appear');
+ Event.stop(event);
+}
 // ===== End of Ajax Functions ===== //
 
 function submitFormDisableSubmits(form) {