git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change the behavior of how :visible and :hidden work. :hidden is when an element...
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
508060a
..
d78ec7e
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-75,7
+75,9
@@
jQuery.fn = jQuery.prototype = {
this.context = selector.context;
}
this.context = selector.context;
}
- return this.setArray(jQuery.makeArray(selector));
+ return this.setArray(jQuery.isArray( selector ) ?
+ selector :
+ jQuery.makeArray(selector));
},
// Start with an empty selector
},
// Start with an empty selector
@@
-95,7
+97,7
@@
jQuery.fn = jQuery.prototype = {
return num === undefined ?
// Return a 'clean' array
return num === undefined ?
// Return a 'clean' array
- jQuery.makeArray( this ) :
+ Array.prototype.slice.call( this ) :
// Return just the object
this[ num ];
// Return just the object
this[ num ];
@@
-265,23
+267,21
@@
jQuery.fn = jQuery.prototype = {
},
// For internal use only.
},
// For internal use only.
- // Behaves like an Array's .push method, not like a jQuery method.
+ // Behaves like an Array's method, not like a jQuery method.
push: [].push,
push: [].push,
+ sort: [].sort,
+ splice: [].splice,
find: function( selector ) {
find: function( selector ) {
- if ( this.length === 1 && !/,/.test(selector) ) {
+ if ( this.length === 1 ) {
var ret = this.pushStack( [], "find", selector );
ret.length = 0;
jQuery.find( selector, this[0], ret );
return ret;
} else {
var ret = this.pushStack( [], "find", selector );
ret.length = 0;
jQuery.find( selector, this[0], ret );
return ret;
} else {
- var elems = jQuery.map(this, function(elem){
+ return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
return jQuery.find( selector, elem );
return jQuery.find( selector, elem );
- });
-
- return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
- jQuery.unique( elems ) :
- elems, "find", selector );
+ })), "find", selector );
}
},
}
},