]> source.dussan.org Git - jquery.git/commitdiff
Make sure that .html(Function) gets the correct previous value.
authorjeresig <jeresig@gmail.com>
Thu, 7 Jan 2010 18:33:30 +0000 (13:33 -0500)
committerjeresig <jeresig@gmail.com>
Thu, 7 Jan 2010 18:33:30 +0000 (13:33 -0500)
src/manipulation.js

index 081bb54819c6866f362ad443cbe962d477eec8c0..9ed22baaf848ba2451fbf59e165828af6e189d8a 100644 (file)
@@ -196,6 +196,14 @@ jQuery.fn.extend({
                                this.empty().append( value );
                        }
 
+               } else if ( jQuery.isFunction( value ) ) {
+                       this.each(function(i){
+                               var self = jQuery(this), old = self.html();
+                               self.empty().append(function(){
+                                       return value.call( this, i, old );
+                               });
+                       });
+
                } else {
                        this.empty().append( value );
                }