aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-12-12 17:05:50 -0500
committerDave Methvin <dave.methvin@gmail.com>2012-12-13 09:19:41 -0500
commit0018f7700bf8004d573c752ecbf66f299769c4de (patch)
treed6f2094bec52150ad0b0298748ec7b524b5c778e /src
parent40e08f81bd880afc5197ab145bce30d28e88c88f (diff)
downloadjquery-0018f7700bf8004d573c752ecbf66f299769c4de.tar.gz
jquery-0018f7700bf8004d573c752ecbf66f299769c4de.zip
Fix #11230. .appendTo and pals should always stack.
Diffstat (limited to 'src')
-rw-r--r--src/manipulation.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index b9d5f0ff1..40885e95c 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -512,21 +512,15 @@ jQuery.each({
i = 0,
ret = [],
insert = jQuery( selector ),
- l = insert.length,
- parent = this.length === 1 && this[0].parentNode;
+ last = insert.length - 1;
- if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) {
- insert[ original ]( this[0] );
- return this;
- } else {
- for ( ; i < l; i++ ) {
- elems = ( i > 0 ? this.clone(true) : this ).get();
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone(true);
jQuery( insert[i] )[ original ]( elems );
- ret = ret.concat( elems );
+ core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
- }
};
});