for ( var name in commands )\r
{\r
command = commands[ name ];\r
- command[ command.modes[ mode ] ? 'enable' : 'disable' ]();\r
+ command[ command.startDisabled ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ]();\r
}\r
}\r
\r
if ( !noUpdate )\r
this.updateElement();\r
\r
+ if ( this.mode )\r
+ {\r
+ // -> currentMode.unload( holderElement );\r
+ this._.modes[ this.mode ].unload( this.getThemeSpace( 'contents' ) );\r
+ }\r
+\r
this.theme.destroy( this );\r
+\r
+ var toolbars,\r
+ index = 0,\r
+ j,\r
+ items,\r
+ instance;\r
+\r
+ if ( this.toolbox )\r
+ {\r
+ toolbars = this.toolbox.toolbars;\r
+ for ( ; index < toolbars.length ; index++ )\r
+ {\r
+ items = toolbars[ index ].items;\r
+ for ( j = 0 ; j < items.length ; j++ )\r
+ {\r
+ instance = items[ j ];\r
+ if ( instance.clickFn ) CKEDITOR.tools.removeFunction( instance.clickFn );\r
+ if ( instance.keyDownFn ) CKEDITOR.tools.removeFunction( instance.keyDownFn );\r
+\r
+ if ( instance.index ) CKEDITOR.ui.button._.instances[ instance.index ] = null;\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( this.contextMenu )\r
+ CKEDITOR.tools.removeFunction( this.contextMenu._.functionId );\r
+\r
+ if ( this._.filebrowserFn )\r
+ CKEDITOR.tools.removeFunction( this._.filebrowserFn );\r
+\r
this.fire( 'destroy' );\r
CKEDITOR.remove( this );\r
CKEDITOR.fire( 'instanceDestroyed', null, this );\r