git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed typo in comments
[jquery.git]
/
src
/
manipulation.js
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
3db2c35
..
742ec25
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-77,7
+77,14
@@
jQuery.fn.extend({
wrapInner: function( html ) {
return this.each(function() {
wrapInner: function( html ) {
return this.each(function() {
- jQuery( this ).contents().wrapAll( html );
+ var self = jQuery( this ), contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
});
},
});
},