aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-01-07 00:13:57 +0000
committerJohn Resig <jeresig@gmail.com>2009-01-07 00:13:57 +0000
commitd8706c5ac95a0e17ac0bb84d5ff3ee7a6eb38161 (patch)
treef14425995596e4147a4d2a353c987be181d18412 /src/core.js
parentef661a50b9c03b922fa2269ec8f5bfbac09d93a4 (diff)
downloadjquery-d8706c5ac95a0e17ac0bb84d5ff3ee7a6eb38161.tar.gz
jquery-d8706c5ac95a0e17ac0bb84d5ff3ee7a6eb38161.zip
Landed a number of improvements to the selector engine. Results are auto-merged onto the jQuery
object, class filtering is now done inline, and not filtering is more efficient.
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core.js b/src/core.js
index e2f1f0b33..c4c386717 100644
--- a/src/core.js
+++ b/src/core.js
@@ -260,9 +260,14 @@ jQuery.fn = jQuery.prototype = {
return this.prevObject || jQuery( [] );
},
+ push: [].push,
+
find: function( selector ) {
- if ( this.length === 1 ) {
- return this.pushStack( jQuery.find( selector, this[0] ), "find", selector );
+ if ( this.length === 1 && !/,/.test(selector) ) {
+ 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 jQuery.find( selector, elem );