X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmanipulation.js;h=8c188c2d565e83f853450f5ade778a6e20fa9ca2;hb=eed69eccc54d010889b5d8495320538d7ceb4e51;hp=4d0ffd0571b733de3df42a29aaedc175c790a8e9;hpb=bed759c95ca6d796125653b540e8611dc63b38bb;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 4d0ffd0..8c188c2 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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(); @@ -227,6 +233,12 @@ jQuery.fn.extend({ // this can help fix replacing a parent with child elements if ( !jQuery.isFunction( value ) ) { value = jQuery( value ).detach(); + + } else { + return this.each(function(i) { + var self = jQuery(this), old = self.html(); + self.replaceWith( value.call( this, i, old ) ); + }); } return this.each(function() {