Ticket #4999: 4999_2.patch
File 4999_2.patch, 1.4 KB (added by , 13 years ago) |
---|
-
_source/core/editor.js
582 582 * 583 583 * @param {String} data HTML code to replace the curent content in the editor. 584 584 * @param {Function} callback Function to be called after the setData is completed. 585 * @param {Boolean} noUndo Specify false to avoid editor from creating undo snapshot for this load. 585 586 * @example 586 587 * CKEDITOR.instances.editor1.<b>setData( '<p>This is the editor data.</p>' )</b>; 587 588 * CKEDITOR.instances.editor1.setData( '<p>Some other editor data.</p>', function() … … 589 590 * CKEDITOR.instances.editor1.checkDirty(); // true 590 591 * } ); 591 592 */ 592 setData : function( data , callback )593 setData : function( data , callback, noUndo ) 593 594 { 594 if( callback )595 { 596 595 noUndo !== false && this.fire( 'saveSnapshot' ); 596 597 this.on( 'dataReady', function( evt ) 597 598 { 598 599 evt.removeListener(); 599 callback .call( evt.editor );600 });601 }600 callback && callback.call( evt.editor ); 601 noUndo !== false && this.fire( 'saveSnapshot' ); 602 }); 602 603 // Fire "setData" so data manipulation may happen. 603 604 var eventData = { dataValue : data }; 604 605 this.fire( 'setData', eventData );