X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ftemplates%2Fdialogs%2Ftemplates.js;h=770eeefb0471420a5d9fa382e025bd703fbe382b;hb=c6e377a02b54abc07129d72b632763c727476a15;hp=334d313b89ad35ac5e1345ffe972024a8d34ccba;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index 334d313..770eeef 100644 --- a/_source/plugins/templates/dialogs/templates.js +++ b/_source/plugins/templates/dialogs/templates.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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