mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fix #10812, let .before() and .after() work on empty collections.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user