Make work wrapInner(fn) work consistently. Fixes #5799.

This commit is contained in:
jeresig 2010-01-25 19:16:23 -05:00
parent 55a64cf095
commit 9f17e70ae9
2 changed files with 20 additions and 8 deletions

View file

@ -77,6 +77,12 @@ jQuery.fn.extend({
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ), contents = self.contents();