Ticket #5162: 5162.patch

File 5162.patch, 1.7 KB (added by Alfonso Martínez de Lizarrondo, 10 years ago)

Proposed patch

  • _samples/ajax.html

     
    2727        var html = document.getElementById( 'editorcontents' ).innerHTML;
    2828
    2929        // Create a new editor inside the <div id="editor">
    30         editor = CKEDITOR.appendTo( 'editor' );
    31         editor.setData( html );
     30        editor = CKEDITOR.appendTo( 'editor' , {  on:{'instanceReady':function(e) { e.editor.setData( html, null, false )} } });
    3231
    3332        // This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead:
    3433        /*
  • _source/core/editor.js

     
    564564                                var element = this.element;
    565565                                if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
    566566                                        data = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
     567                                else
     568                                        data = '';
    567569                        }
    568570
    569571                        return data;
     
    582584                 *
    583585                 * @param {String} data HTML code to replace the curent content in the editor.
    584586                 * @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.   
     587                 * @param {Boolean} noUndo Specify false to avoid editor from creating undo snapshot for this load.
    586588                 * @example
    587589                 * CKEDITOR.instances.editor1.<b>setData( '&lt;p&gt;This is the editor data.&lt;/p&gt;' )</b>;
    588590                 * CKEDITOR.instances.editor1.setData( '&lt;p&gt;Some other editor data.&lt;/p&gt;', function()
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy