Ticket #8226: 8226_5.patch

File 8226_5.patch, 2.1 KB (added by Alfonso Martínez de Lizarrondo, 13 years ago)

Updated patch

  • _source/core/dom/element.js

     
    14791479                                }
    14801480                        }
    14811481
    1482                         return $ && new CKEDITOR.dom.document( $.contentWindow.document );
     1482                        return $ && $.contentWindow && new CKEDITOR.dom.document( $.contentWindow.document );
    14831483                },
    14841484
    14851485                /**
     
    15801580                        return this.$.childNodes.length;
    15811581                },
    15821582
     1583                /**
     1584                 *  Whether this element is not present in the DOM tree.
     1585                 */
     1586                isOffline : function()
     1587                {
     1588                        var root = this.getDocument().getDocumentElement();
     1589                        return !root.contains( this );
     1590                },
     1591
    15831592                disableContextMenu : function()
    15841593                {
    15851594                        this.on( 'contextmenu', function( event )
  • _source/core/editor.js

     
    465465                                                || getNewName();
    466466
    467467                        if ( this.name in CKEDITOR.instances )
    468                                 throw '[CKEDITOR.editor] The instance "' + this.name + '" already exists.';
     468                        {
     469                                var previous = CKEDITOR.instances[ this.name ];
    469470
     471                                // Destroy detached editor silently.
     472                                if ( previous.element.isOffline() || previous.container && previous.container.isOffline() )
     473                                        previous.destroy( false );
     474                                else
     475                                        throw '[CKEDITOR.editor] The instance "' + previous.name + '" already exists.';
     476                        }
     477
    470478                        /**
    471479                         * A unique random string assigned to each editor instance on the page.
    472480                         * @name CKEDITOR.editor.prototype.id
  • _source/plugins/wysiwygarea/plugin.js

     
    10321032                                                                        xmlDeclaration = fullPage && editor.xmlDeclaration,
    10331033                                                                        doc = iframe.getFrameDocument();
    10341034
     1035                                                                if ( !doc )
     1036                                                                        return null;
     1037
    10351038                                                                var data = fullPage
    10361039                                                                        ? doc.getDocumentElement().getOuterHtml()
    10371040                                                                        : doc.getBody().getHtml();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy