mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Merge branch '8017lint' of https://github.com/rwldrn/jquery into 8017lint
This commit is contained in:
parent
1922f311a3
commit
f1bd0cfc4d
@ -486,7 +486,8 @@ jQuery.extend({
|
|||||||
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
||||||
var clone = elem.cloneNode(true),
|
var clone = elem.cloneNode(true),
|
||||||
srcElements,
|
srcElements,
|
||||||
destElements;
|
destElements,
|
||||||
|
i;
|
||||||
|
|
||||||
if ( !jQuery.support.noCloneEvent && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
if ( !jQuery.support.noCloneEvent && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
||||||
// IE copies events bound via attachEvent when using cloneNode.
|
// IE copies events bound via attachEvent when using cloneNode.
|
||||||
@ -503,7 +504,7 @@ jQuery.extend({
|
|||||||
// Weird iteration because IE will replace the length property
|
// Weird iteration because IE will replace the length property
|
||||||
// with an element if you are cloning the body and one of the
|
// with an element if you are cloning the body and one of the
|
||||||
// elements on the page has a name or id of "length"
|
// elements on the page has a name or id of "length"
|
||||||
for ( var i = 0; srcElements[i]; ++i ) {
|
for ( i = 0; srcElements[i]; ++i ) {
|
||||||
cloneFixAttributes( srcElements[i], destElements[i] );
|
cloneFixAttributes( srcElements[i], destElements[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,7 +522,7 @@ jQuery.extend({
|
|||||||
destElements = clone.getElementsByTagName("*");
|
destElements = clone.getElementsByTagName("*");
|
||||||
|
|
||||||
if ( srcElements.length ) {
|
if ( srcElements.length ) {
|
||||||
for ( var i = 0; srcElements[i]; ++i ) {
|
for ( i = 0; srcElements[i]; ++i ) {
|
||||||
cloneCopyEvent( srcElements[i], destElements[i] );
|
cloneCopyEvent( srcElements[i], destElements[i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -880,7 +880,7 @@ test("jQuery.clone() (#8017)", function() {
|
|||||||
var main = jQuery("#main")[0],
|
var main = jQuery("#main")[0],
|
||||||
clone = jQuery.clone( main );
|
clone = jQuery.clone( main );
|
||||||
|
|
||||||
equals( main.children.length, clone.children.length, "Simple child length to ensure a large dom tree copies correctly" );
|
equals( main.childNodes.length, clone.childNodes.length, "Simple child length to ensure a large dom tree copies correctly" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("clone()", function() {
|
test("clone()", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user