diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-11-17 11:47:56 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-11-17 11:47:56 -0500 |
commit | dd845a2c0f63f97e74e4d490ee66e12e0bf180c5 (patch) | |
tree | d2a67f9c0eab037b5b29a6dee8b8fdcefac8b60e /src | |
parent | 7c2d6c8cd87ce62210ca9f72bf132d4b1a797940 (diff) | |
download | jquery-dd845a2c0f63f97e74e4d490ee66e12e0bf180c5.tar.gz jquery-dd845a2c0f63f97e74e4d490ee66e12e0bf180c5.zip |
Fix #10812, let .before() and .after() work on empty collections.
Diffstat (limited to 'src')
-rw-r--r-- | src/manipulation.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 9baa04203..28d63b8a2 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -154,7 +154,7 @@ jQuery.fn.extend({ this.parentNode.insertBefore( elem, this ); }); } else if ( arguments.length ) { - var set = jQuery(arguments[0]); + var set = jQuery.clean( arguments ); set.push.apply( set, this.toArray() ); return this.pushStack( set, "before", arguments ); } @@ -167,7 +167,7 @@ jQuery.fn.extend({ }); } else if ( arguments.length ) { var set = this.pushStack( this, "after", arguments ); - set.push.apply( set, jQuery(arguments[0]).toArray() ); + set.push.apply( set, jQuery.clean(arguments) ); return set; } }, |