git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding in the change recommended by Alexander Farkas to fix some bugs in the change...
[jquery.git]
/
src
/
manipulation.js
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
3db2c35
..
59edcbc
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 );
+ }
});
},
});
},
@@
-315,7
+322,7
@@
function cloneCopyEvent(orig, ret) {
}
function buildFragment( args, nodes, scripts ) {
}
function buildFragment( args, nodes, scripts ) {
- var fragment, cacheable, cached, cacheresults, doc;
+ var fragment, cacheable, cacheresults, doc;
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
cacheable = true;
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
cacheable = true;
@@
-324,7
+331,6
@@
function buildFragment( args, nodes, scripts ) {
if ( cacheresults !== 1 ) {
fragment = cacheresults;
}
if ( cacheresults !== 1 ) {
fragment = cacheresults;
}
- cached = true;
}
}
}
}