Ticket #4445: 4445.patch
File 4445.patch, 3.5 KB (added by , 14 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
214 214 var mainElement, 215 215 fieldset, 216 216 iframe, 217 isLoadingData,218 217 isPendingFocus, 219 218 frameLoaded, 220 219 fireMode; … … 448 447 fireMode = false; 449 448 } 450 449 451 isLoadingData = false;450 delete editor._.isLoadingData; 452 451 453 452 if ( isPendingFocus ) 454 453 { … … 503 502 504 503 loadData : function( data ) 505 504 { 506 isLoadingData = true;505 editor._.isLoadingData = true; 507 506 508 507 // Get the HTML version of the data. 509 508 if ( editor.dataProcessor ) … … 573 572 574 573 focus : function() 575 574 { 576 if ( isLoadingData )575 if ( editor._.isLoadingData ) 577 576 isPendingFocus = true; 578 577 else if ( editor.window ) 579 578 { -
_source/plugins/newpage/plugin.js
19 19 exec : function( editor ) 20 20 { 21 21 var command = this; 22 function afterCommand()22 editor.setData( editor.config.newpage_html, function() 23 23 { 24 // Defer to happen after 'selectionChange'. 25 setTimeout( function() 26 { 27 editor.fire( 'afterCommandExec', 28 { 29 name: command.name, 30 command: command 31 } ); 32 }, 500 ); 33 } 34 if ( editor.mode == 'wysiwyg') 35 editor.on( 'contentDom', function( evt ){ 36 37 evt.removeListener(); 38 afterCommand(); 39 } ); 40 41 editor.setData( editor.config.newpage_html ); 24 editor.fire( 'afterCommandExec', 25 { 26 name: command.name, 27 command: command 28 } ); 29 } ); 42 30 editor.focus(); 43 44 if( editor.mode == 'source' )45 afterCommand();46 47 31 }, 48 32 async : true 49 33 }); -
_source/core/editor.js
567 567 /** 568 568 * Sets the editor data. The data must be provided in raw format. 569 569 * @param {String} data HTML code to replace the curent content in the editor. 570 * @param {Function} callback Function to be called after the setData is completed. 570 571 * @example 571 572 * CKEDITOR.instances.editor1.<b>setData( '<p>This is the editor data.</p>' )</b>; 573 * CKEDITOR.instances.editor1.setData( '<p>Some other editor data.</p>', function() 574 * { 575 * CKEDITOR.instances.editor1.checkDirty(); // true 576 * } ); 572 577 */ 573 setData : function( data )578 setData : function( data , callback ) 574 579 { 575 580 // Fire "setData" so data manipulation may happen. 576 581 var eventData = { dataValue : data }; … … 579 584 this._.data = eventData.dataValue; 580 585 581 586 this.fire( 'afterSetData', eventData ); 587 588 if( callback ) 589 { 590 if( this._.isLoadingData ) 591 this.on( 'contentDom', function( evt ) 592 { 593 // A short delay to make sure cursor 594 // has started blinking. 595 setTimeout( callback, 300 ); 596 } ); 597 else 598 callback(); 599 } 582 600 }, 583 601 584 602 /**