// Build the inner HTML of our new item DIV.\r
var html = '<table style="width:350px;" class="cke_tpl_preview"><tr>';\r
\r
- if( template.image && imagesPath )\r
+ if ( template.image && imagesPath )\r
html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"></td>';\r
\r
html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>';\r
\r
- if( template.description )\r
+ if ( template.description )\r
html += '<span>' + template.description + '</span>';\r
\r
html += '</td></tr></table>';\r
var dialog = CKEDITOR.dialog.getCurrent(),\r
isInsert = dialog.getValueOf( 'selectTpl', 'chkInsertOpt' );\r
\r
- if( isInsert )\r
+ if ( isInsert )\r
{\r
// Everything should happen after the document is loaded (#4073).\r
editor.on( 'contentDom', function( evt )\r
var range = new CKEDITOR.dom.range( editor.document );\r
range.moveToElementEditStart( editor.document.getBody() );\r
range.select( true );\r
+ setTimeout( function ()\r
+ {\r
+ editor.fire( 'saveSnapshot' );\r
+ }, 0 );\r
} );\r
+\r
+ editor.fire( 'saveSnapshot' );\r
editor.setData( html );\r
}\r
else\r