[portal-commits] JBoss Portal SVN: r12944 - branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Wed Mar 4 11:39:24 EST 2009


Author: chris.laprun at jboss.com
Date: 2009-03-04 11:39:24 -0500 (Wed, 04 Mar 2009)
New Revision: 12944

Modified:
   branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js
Log:
- Started work on more generic solution to JBPORTAL-2329. Can't get it work... :(

Modified: branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js
===================================================================
--- branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js	2009-03-04 16:38:25 UTC (rev 12943)
+++ branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js	2009-03-04 16:39:24 UTC (rev 12944)
@@ -21,6 +21,53 @@
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
  ******************************************************************************/
 
+/*var currentSubmit = null;
+
+ function decorateSubmits()
+ {
+ var submits = $$('input[type=submit]');
+ for(var i = 0; i < submits.length; i++)
+ {
+ var submit = submits[i];
+ var oldonclick = submit.onclick;
+
+ if(typeof oldonclick != 'function')
+ {
+ submit.onclick = function()
+ {
+ currentSubmit = this.name;
+ };
+ }
+ else
+ {
+ submit.onclick = function ()
+ {
+ oldonclick();
+ currentSubmit = this.name;
+ };
+ }
+ }
+ }
+
+
+ function addLoadEvent(func)
+ {
+ var oldonload = window.onload;
+ if (typeof window.onload != 'function')
+ {
+ window.onload = func;
+ }
+ else
+ {
+ window.onload = function()
+ {
+ oldonload();
+ func();
+ };
+ }
+ }
+ addLoadEvent(decorateSubmits());*/
+
 function sendData(action, windowId, fromPos, fromRegionId, toPos, toRegionId)
 {
    var options = {
@@ -41,7 +88,7 @@
       onLoading: function(t)
       {
       }
-   }
+   };
    new Ajax.Request(server_base_url + "/ajax", options);
 }
 
@@ -166,6 +213,8 @@
                      options.enctype = enctype;
                      options.asynchronous = false;
                      options.method = "post"
+                     // TODO: inject currentSubmit value in serialization instead of only getting the value of the first submit input
+                     // see http://groups.google.com/group/prototype-core/browse_thread/thread/b3ced6a52dd5968b?pli=1
                      options.postBody = Form.serialize(current);
                   }
                }




More information about the portal-commits mailing list