[Jifty-commit] r4948 - jifty/branches/jquery/share/web/static/js

Jifty commits jifty-commit at lists.jifty.org
Sun Jan 27 07:12:45 EST 2008


Author: gugod
Date: Sun Jan 27 07:12:39 2008
New Revision: 4948

Modified:
   jifty/branches/jquery/share/web/static/js/jifty.js

Log:
re-define Form.getElements in jQuery way.


Modified: jifty/branches/jquery/share/web/static/js/jifty.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/jifty.js	(original)
+++ jifty/branches/jquery/share/web/static/js/jifty.js	Sun Jan 27 07:12:39 2008
@@ -505,15 +505,17 @@
 Form = {};
 
 jQuery.extend(Form, {
+    getElements: function(element) {
+        return jQuery.makeArray( jQuery(":input", element) );
+    },
     // Return an Array of Actions that are in this form
     getActions: function (element) {
         var elements = new Array;
-        var possible = Form.getElements(element);
 
-        for (var i = 0; i < possible.length; i++) {
-            if (Form.Element.getType(possible[i]) == "registration")
-                elements.push(Form.Element.getAction(possible[i]));
-        }
+        jQuery(":input", element).each(function() {
+            if (Form.Element.getType(this) == "registration")
+                elements.push(Form.Element.getAction(possible[i]));            
+        });
 
         return elements;
     },


More information about the Jifty-commit mailing list