Ticket #8226: 8226_3.patch
File 8226_3.patch, 3.0 KB (added by , 12 years ago) |
---|
-
_source/core/dom/element.js
1479 1479 } 1480 1480 } 1481 1481 1482 return $ && new CKEDITOR.dom.document( $.contentWindow.document );1482 return $ && $.contentWindow && new CKEDITOR.dom.document( $.contentWindow.document ); 1483 1483 }, 1484 1484 1485 1485 /** … … 1580 1580 return this.$.childNodes.length; 1581 1581 }, 1582 1582 1583 /** 1584 * Whether this element is not yet presented in the DOM tree. 1585 */ 1586 isOffline : function() 1587 { 1588 var root = this.getDocument().getDocumentElement(); 1589 return !root.contains( this ); 1590 }, 1591 1583 1592 disableContextMenu : function() 1584 1593 { 1585 1594 this.on( 'contextmenu', function( event ) -
_source/plugins/wysiwygarea/plugin.js
1032 1032 xmlDeclaration = fullPage && editor.xmlDeclaration, 1033 1033 doc = iframe.getFrameDocument(); 1034 1034 1035 if ( !doc ) 1036 return null; 1037 1035 1038 var data = fullPage 1036 1039 ? doc.getDocumentElement().getOuterHtml() 1037 1040 : doc.getBody().getHtml(); -
_source/core/editor.js
465 465 || getNewName(); 466 466 467 467 if ( this.name in CKEDITOR.instances ) 468 throw '[CKEDITOR.editor] The instance "' + this.name + '" already exists.'; 468 { 469 var previous = CKEDITOR.instances[ this.name ]; 469 470 471 // Destroy detached editor silently. 472 if ( previous.checkDetached() ) 473 previous.destroy( false ); 474 else 475 throw '[CKEDITOR.editor] The instance "' + previous.name + '" already exists.'; 476 } 477 470 478 /** 471 479 * A unique random string assigned to each editor instance on the page. 472 480 * @name CKEDITOR.editor.prototype.id … … 562 570 */ 563 571 destroy : function( noUpdate ) 564 572 { 565 if ( ! noUpdate)566 this.updateElement();567 568 this.fire( 'destroy');569 this.theme && this.theme.destroy( this );573 if ( !this.checkDetached() ) 574 { 575 !noUpdate && this.updateElement(); 576 this.theme && this.theme.destroy( this ); 577 } 570 578 579 this.fire( 'destroy' ); 571 580 CKEDITOR.remove( this ); 572 581 CKEDITOR.fire( 'instanceDestroyed', null, this ); 573 582 }, … … 865 874 else 866 875 element.setHtml( data ); 867 876 } 877 }, 878 879 /** 880 * Check whether the editor UI has been removed from DOM thus 881 * the editor instance is considered to be obsoleted. 882 * @since 3.6.2 883 * @example 884 * editor.container.remove(); 885 * alert( editor.checkDetached() ); 886 */ 887 checkDetached : function() 888 { 889 this.element.isOffline() || this.container && this.container.isOffline(); 868 890 } 869 891 }); 870 892