X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Ftemplates%2Fdialogs%2Ftemplates.js;h=770eeefb0471420a5d9fa382e025bd703fbe382b;hp=42a6a93290c1fca6c0874cd6b937bdb04f968417;hb=c6e377a02b54abc07129d72b632763c727476a15;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6 diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index 42a6a93..770eeef 100644 --- a/_source/plugins/templates/dialogs/templates.js +++ b/_source/plugins/templates/dialogs/templates.js @@ -39,12 +39,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Build the inner HTML of our new item DIV. var html = ''; - if( template.image && imagesPath ) + if ( template.image && imagesPath ) html += ''; html += '
' + template.title + '
'; - if( template.description ) + if ( template.description ) html += '' + template.description + ''; html += '
'; @@ -79,7 +79,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var dialog = CKEDITOR.dialog.getCurrent(), isInsert = dialog.getValueOf( 'selectTpl', 'chkInsertOpt' ); - if( isInsert ) + if ( isInsert ) { // Everything should happen after the document is loaded (#4073). editor.on( 'contentDom', function( evt ) @@ -91,7 +91,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var range = new CKEDITOR.dom.range( editor.document ); range.moveToElementEditStart( editor.document.getBody() ); range.select( true ); + setTimeout( function () + { + editor.fire( 'saveSnapshot' ); + }, 0 ); } ); + + editor.fire( 'saveSnapshot' ); editor.setData( html ); } else