git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that the correct context is being passed in for replaceWith(fn). Fixes...
[jquery.git]
/
src
/
manipulation.js
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
37a8cfd
..
8c188c2
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-233,6
+233,12
@@
jQuery.fn.extend({
// this can help fix replacing a parent with child elements
if ( !jQuery.isFunction( value ) ) {
value = jQuery( value ).detach();
// 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() {
}
return this.each(function() {