JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.2
[ckeditor.git] / _source / core / editor.js
index 3f1f54d..d66aac9 100644 (file)
@@ -547,9 +547,9 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
                        if ( !noUpdate )\r
                                this.updateElement();\r
 \r
+                       this.fire( 'destroy' );\r
                        this.theme && this.theme.destroy( this );\r
 \r
-                       this.fire( 'destroy' );\r
                        CKEDITOR.remove( this );\r
                        CKEDITOR.fire( 'instanceDestroyed', null, this );\r
                },\r
@@ -684,6 +684,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
                 *              editor.\r
                 * @param {Function} callback Function to be called after the setData\r
                 *              is completed.\r
+                *@param {Boolean} internal Whether suppress  any event firing when copying data internally inside editor.\r
                 * @example\r
                 * CKEDITOR.instances.editor1.<b>setData</b>( '&lt;p&gt;This is the editor data.&lt;/p&gt;' );\r
                 * @example\r
@@ -692,7 +693,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
                 *         this.checkDirty();    // true\r
                 *     });\r
                 */\r
-               setData : function( data , callback )\r
+               setData : function( data , callback, internal )\r
                {\r
                        if( callback )\r
                        {\r
@@ -705,11 +706,11 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
 \r
                        // Fire "setData" so data manipulation may happen.\r
                        var eventData = { dataValue : data };\r
-                       this.fire( 'setData', eventData );\r
+                       !internal && this.fire( 'setData', eventData );\r
 \r
                        this._.data = eventData.dataValue;\r
 \r
-                       this.fire( 'afterSetData', eventData );\r
+                       !internal && this.fire( 'afterSetData', eventData );\r
                },\r
 \r
                /**\r