Author: chris.laprun(a)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/b3ced6...
options.postBody = Form.serialize(current);
}
}