Ticket #6419: 6419_4.patch

File 6419_4.patch, 2.0 KB (added by Tobiasz Cudnik, 13 years ago)
  • _source/core/dom/node.js

     
    107107                {
    108108                        var $clone = this.$.cloneNode( includeChildren );
    109109
    110                         if ( !cloneId )
    111                         {
    112                                 var removeIds = function( node )
    113                                 {
    114                                         if ( node.nodeType != CKEDITOR.NODE_ELEMENT )
    115                                                 return;
     110                        var removeIds = function( node )
     111                        {
     112                                if ( node.nodeType != CKEDITOR.NODE_ELEMENT )
     113                                        return;
    116114
    117                                         node.removeAttribute( 'id', false ) ;
    118                                         node.removeAttribute( '_cke_expando', false ) ;
     115                                if ( !cloneId )
     116                                        node.removeAttribute( 'id', false );
     117                                node.removeAttribute( '_cke_expando', false );
    119118
     119                                if ( includeChildren )
     120                                {
    120121                                        var childs = node.childNodes;
    121                                         for ( var i=0 ; i < childs.length ; i++ )
     122                                        for ( var i=0; i < childs.length; i++ )
    122123                                                removeIds( childs[ i ] );
    123                                 };
     124                                }
     125                        };
    124126
    125                                 // The "id" attribute should never be cloned to avoid duplication.
    126                                 removeIds( $clone );
    127                         }
     127                        // The "id" attribute should never be cloned to avoid duplication.
     128                        removeIds( $clone );
    128129
    129130                        return new CKEDITOR.dom.node( $clone );
    130131                },
  • _source/core/dom/domobject.js

     
    167167        /**
    168168         * Sets a data slot value for this object. These values are shared by all
    169169         * instances pointing to that same DOM object.
     170         * <strong>Note:</strong> The created data slot is only guarantied to be available on this unique dom node,
     171         * thus any wish to continue access it from other element clones (either created by clone node or from innerHtml)
     172         * will fail, for such usage, please use {@link CKEDITOR.dom.element::setAttribute} instead.
    170173         * @name CKEDITOR.dom.domObject.prototype.setCustomData
    171174         * @function
    172175         * @param {String} key A key used to identify the data slot.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy