git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added a couple missing semicolons and fixed a typo in the comments
[jquery.git]
/
src
/
manipulation.js
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
a8cb484
..
d5523dd
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-32,6
+32,12
@@
if ( !jQuery.support.htmlSerialize ) {
jQuery.fn.extend({
text: function( text ) {
jQuery.fn.extend({
text: function( text ) {
+ if(jQuery.isFunction(text)) {
+ return this.each(function() {
+ return jQuery(this).text( text.call(this) );
+ });
+ }
+
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
@@
-48,7
+54,7
@@
jQuery.fn.extend({
if ( this[0] ) {
// The elements to wrap the target around
if ( this[0] ) {
// The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone();
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
@@
-87,7
+93,7
@@
jQuery.fn.extend({
}
}).end();
},
}
}).end();
},
-
+
append: function() {
return this.domManip(arguments, true, function(elem){
if ( this.nodeType === 1 ) {
append: function() {
return this.domManip(arguments, true, function(elem){
if ( this.nodeType === 1 ) {
@@
-273,17
+279,11
@@
function cloneCopyEvent(orig, ret) {
var i = 0;
ret.each(function(){
var i = 0;
ret.each(function(){
- if ( this.nodeName !== orig[i].nodeName ) {
+ if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
return;
}
return;
}
- var events = jQuery.data( orig[i], "events" );
-
- for ( var type in events ) {
- for ( var handler in events[ type ] ) {
- jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
- }
- }
+ jQuery.data( this, jQuery.data( orig[i++] ) );
});
}
});
}
@@
-463,7
+463,7
@@
jQuery.extend({
function cleanData( elems ) {
for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
function cleanData( elems ) {
for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
- if ( (id = elem[expando]) ) {
+ if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
delete jQuery.cache[ id ];
}
}
delete jQuery.cache[ id ];
}
}