/*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
if ( !isHandlingData && editor.mode )\r
{\r
isHandlingData = true;\r
- editor.setData( getMode( editor ).getData() );\r
+ editor.setData( getMode( editor ).getData(), null, 1 );\r
isHandlingData = false;\r
}\r
});\r
// Do that once only.\r
event.removeListener();\r
\r
- // Grab editor focus if the editor container is focused. (#3104)\r
- var focusGrabber = editor.container;\r
-\r
- // Safari 3 can't handle tabindex in all elements, so we do\r
- // a trick to make it move the focus to the editor on TAB.\r
- if ( CKEDITOR.env.webkit && CKEDITOR.env.version < 528 )\r
- {\r
- var tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0;\r
- focusGrabber = focusGrabber.append( CKEDITOR.dom.element.createFromHtml(\r
- '<input' +\r
- ' tabindex="' + tabIndex + '"' +\r
- ' style="position:absolute; left:-10000">' ) );\r
- }\r
-\r
- focusGrabber.on( 'focus', function()\r
+ // Redirect the focus into editor for webkit. (#5713)\r
+ CKEDITOR.env.webkit && editor.container.on( 'focus', function()\r
{\r
editor.focus();\r
});\r
setTimeout( function(){\r
editor.fireOnce( 'instanceReady' );\r
CKEDITOR.fire( 'instanceReady', null, editor );\r
- } );\r
+ }, 0 );\r
});\r
+\r
+ editor.on( 'destroy', function ()\r
+ {\r
+ // -> currentMode.unload( holderElement );\r
+ if ( this.mode )\r
+ this._.modes[ this.mode ].unload( this.getThemeSpace( 'contents' ) );\r
+ });\r
}\r
});\r
\r
* @example\r
* config.startupFocus = true;\r
*/\r
-CKEDITOR.config.startupFocus = false;\r
\r
/**\r
* Whether to render or not the editing block area in the editor interface.\r
* config.editingBlock = false;\r
*/\r
CKEDITOR.config.editingBlock = true;\r
+\r
+/**\r
+ * Fired when a CKEDITOR instance is created, fully initialized and ready for interaction.\r
+ * @name CKEDITOR#instanceReady\r
+ * @event\r
+ * @param {CKEDITOR.editor} editor The editor instance that has been created.\r
+ */\r
+\r
+/**\r
+ * Fired when the CKEDITOR instance is created, fully initialized and ready for interaction.\r
+ * @name CKEDITOR.editor#instanceReady\r
+ * @event\r
+ */\r
+\r
+/**\r
+ * Fired before changing the editing mode\r
+ * @name CKEDITOR.editor#beforeModeUnload\r
+ * @event\r
+ */\r