X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Fnode.js;h=a106810f326d23e588a218fdd97c1be1b0a2ea11;hp=661154550ab0a83efd8b080952a664e8e98fb7c2;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hpb=614511639979907ceb0da3614122a4d8eb963ad4 diff --git a/_source/core/dom/node.js b/_source/core/dom/node.js index 6611545..a106810 100644 --- a/_source/core/dom/node.js +++ b/_source/core/dom/node.js @@ -107,24 +107,25 @@ CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype, { var $clone = this.$.cloneNode( includeChildren ); - if ( !cloneId ) + var removeIds = function( node ) { - var removeIds = function( node ) - { - if ( node.nodeType != CKEDITOR.NODE_ELEMENT ) - return; + if ( node.nodeType != CKEDITOR.NODE_ELEMENT ) + return; - node.removeAttribute( 'id', false ) ; - node.removeAttribute( '_cke_expando', false ) ; + if ( !cloneId ) + node.removeAttribute( 'id', false ); + node.removeAttribute( 'data-cke-expando', false ); + if ( includeChildren ) + { var childs = node.childNodes; - for ( var i=0 ; i < childs.length ; i++ ) + for ( var i=0; i < childs.length; i++ ) removeIds( childs[ i ] ); - }; + } + }; - // The "id" attribute should never be cloned to avoid duplication. - removeIds( $clone ); - } + // The "id" attribute should never be cloned to avoid duplication. + removeIds( $clone ); return new CKEDITOR.dom.node( $clone ); }, @@ -243,13 +244,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype, */ getDocument : function() { - var document = new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument ); - - return ( - this.getDocument = function() - { - return document; - })(); + return new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument ); }, getIndex : function()