includes/clientside/static/autofill.js
changeset 1046 cfc6c30c5e2d
parent 787 b0d0d429d8cf
child 1053 bdbb49cf6f1b
--- a/includes/clientside/static/autofill.js	Wed Jul 08 18:53:45 2009 -0400
+++ b/includes/clientside/static/autofill.js	Wed Jul 08 22:27:24 2009 -0400
@@ -60,30 +60,6 @@
   }
 }
 
-window.autofill_onload = function()
-{
-  if ( this.loaded )
-  {
-    return true;
-  }
-  
-  var inputs = document.getElementsByClassName('input', 'autofill');
-  
-  if ( inputs.length > 0 )
-  {
-    // we have at least one input that needs to be made an autofill element.
-    // is spry data loaded?
-    load_component('l10n');
-  }
-  
-  this.loaded = true;
-  
-  for ( var i = 0; i < inputs.length; i++ )
-  {
-    autofill_init_element(inputs[i]);
-  }
-}
-
 window.autofill_init_element = function(element, params)
 {
   if ( element.af_initted )
@@ -126,6 +102,32 @@
   autofill_init_element(el, {});
 }
 
+// note: init, then onload (the latter is called automatically)
+
+window.autofill_onload = function()
+{
+  if ( this.loaded )
+  {
+    return true;
+  }
+  
+  var inputs = document.getElementsByClassName('input', 'autofill');
+  
+  if ( inputs.length > 0 )
+  {
+    // we have at least one input that needs to be made an autofill element.
+    // is spry data loaded?
+    load_component('l10n');
+  }
+  
+  this.loaded = true;
+  
+  for ( var i = 0; i < inputs.length; i++ )
+  {
+    autofill_init_element(inputs[i]);
+  }
+}
+
 window.autofill_init = function()
 {
   load_component(['l10n', 'jquery', 'jquery-ui']);