Changeset 1088


Ignore:
Timestamp:
10/13/08 21:06:08 (6 years ago)
Author:
douglas
Message:

FIXED Ticket #1304 getElementsByName now uses the Xinha function collectionToArray, which was updated with the speed trick from getElementsByName

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r1085 r1088  
    65156515Xinha.collectionToArray = function(collection) 
    65166516{ 
     6517  try 
     6518  { 
     6519    return collection.length ? Array.prototype.slice.call(collection) : []; //Collection to Array 
     6520  } 
     6521  catch(e) 
     6522  { 
     6523    // In certain implementations (*cough* IE), you can't call slice on a 
     6524    // collection.  We'll fallback to using the simple, non-native iterative 
     6525    // approach. 
     6526  } 
     6527 
    65176528  var array = [ ]; 
    65186529  for ( var i = 0; i < collection.length; i++ ) 
  • trunk/modules/Dialogs/XinhaDialog.js

    r1087 r1088  
    529529{ 
    530530  var els = this.document.getElementsByName(this.id[name] ? this.id[name] : name);  
    531   return els.length ? Array.prototype.slice.call(els) : []; //Collection to Array 
     531  return Xinha.collectionToArray(els); 
    532532}; 
    533533/** Return all elements in the dialog that have the given class 
Note: See TracChangeset for help on using the changeset viewer.