Changeset 5500
- Timestamp:
- 05/08/08 16:14:49 (4 days ago)
- Files:
-
- 1 modified
-
trunk/jquery/src/core.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/core.js
r5481 r5500 141 141 142 142 // Locate the position of the desired element 143 this.each(function(i){ 144 if ( this == elem ) 145 ret = i; 146 }); 147 148 return ret; 143 return jQuery.inArray( 144 // If it receives a jQuery object, the first element is used 145 elem && elem.jquery ? elem[0] : elem 146 , this ); 149 147 }, 150 148 … … 1125 1123 inArray: function( elem, array ) { 1126 1124 for ( var i = 0, length = array.length; i < length; i++ ) 1127 if ( array[ i ] == elem ) 1125 // Use === because on IE, window == document 1126 if ( array[ i ] === elem ) 1128 1127 return i; 1129 1128