diff options
Diffstat (limited to '_source/plugins/templates')
| -rw-r--r-- | _source/plugins/templates/dialogs/templates.js | 16 | ||||
| -rw-r--r-- | _source/plugins/templates/plugin.js | 2 | ||||
| -rw-r--r-- | _source/plugins/templates/templates/default.js | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index 52d9692..732511f 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 */ @@ -81,14 +81,24 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if( isInsert ) { + // Everything should happen after the document is loaded (#4073). + editor.on( 'contentDom', function( evt ) + { + evt.removeListener(); + dialog.hide(); + + // Place the cursor at the first editable place. + var range = new CKEDITOR.dom.range( editor.document ); + range.moveToElementEditStart( editor.document.getBody() ); + range.select( true ); + } ); editor.setData( html ); } else { editor.insertHtml( html ); + dialog.hide(); } - - dialog.hide(); } CKEDITOR.dialog.add( 'templates', function( editor ) diff --git a/_source/plugins/templates/plugin.js b/_source/plugins/templates/plugin.js index c2d232c..0c1ae27 100644 --- a/_source/plugins/templates/plugin.js +++ b/_source/plugins/templates/plugin.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 */ diff --git a/_source/plugins/templates/templates/default.js b/_source/plugins/templates/templates/default.js index c433dc3..dc8ef91 100644 --- a/_source/plugins/templates/templates/default.js +++ b/_source/plugins/templates/templates/default.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 */ |
