X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Ftoolbar%2Fplugin.js;h=891b450142078fadabc1e75b049daaaa1b6000a4;hp=4f4cd09e0dfce2f9fc37b043dc050bdf10200399;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hpb=9afde8772159bd3436f1f5b7862960307710ae5a diff --git a/_source/plugins/toolbar/plugin.js b/_source/plugins/toolbar/plugin.js index 4f4cd09..891b450 100644 --- a/_source/plugins/toolbar/plugin.js +++ b/_source/plugins/toolbar/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -346,6 +346,25 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } }); + editor.on( 'destroy', function() + { + var toolbars, index = 0, i, + items, instance; + toolbars = this.toolbox.toolbars; + for ( ; index < toolbars.length; index++ ) + { + items = toolbars[ index ].items; + for ( i = 0; i < items.length; i++ ) + { + instance = items[ i ]; + if ( instance.clickFn ) CKEDITOR.tools.removeFunction( instance.clickFn ); + if ( instance.keyDownFn ) CKEDITOR.tools.removeFunction( instance.keyDownFn ); + + if ( instance.index ) CKEDITOR.ui.button._.instances[ instance.index ] = null; + } + } + }); + editor.addCommand( 'toolbarFocus', commands.toolbarFocus ); } });