X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Feditor.js;h=d66aac9a223c887ebda764673b383fdda3084adf;hp=3f1f54da9c9d037a91da5494a7a5ee5d215ee357;hb=8f6c203fdaa543c3bca40baea6ae4ddcdf1a77f5;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b diff --git a/_source/core/editor.js b/_source/core/editor.js index 3f1f54d..d66aac9 100644 --- a/_source/core/editor.js +++ b/_source/core/editor.js @@ -547,9 +547,9 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, if ( !noUpdate ) this.updateElement(); + this.fire( 'destroy' ); this.theme && this.theme.destroy( this ); - this.fire( 'destroy' ); CKEDITOR.remove( this ); CKEDITOR.fire( 'instanceDestroyed', null, this ); }, @@ -684,6 +684,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, * editor. * @param {Function} callback Function to be called after the setData * is completed. + *@param {Boolean} internal Whether suppress any event firing when copying data internally inside editor. * @example * CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' ); * @example @@ -692,7 +693,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, * this.checkDirty(); // true * }); */ - setData : function( data , callback ) + setData : function( data , callback, internal ) { if( callback ) { @@ -705,11 +706,11 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, // Fire "setData" so data manipulation may happen. var eventData = { dataValue : data }; - this.fire( 'setData', eventData ); + !internal && this.fire( 'setData', eventData ); this._.data = eventData.dataValue; - this.fire( 'afterSetData', eventData ); + !internal && this.fire( 'afterSetData', eventData ); }, /**