X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpanelbutton%2Fplugin.js;h=44d5699c76ba669e73e49e5ce5227aaa2f112012;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=5821c880a6ee8aed4f37a4a807c459f0df9b927f;hpb=039a051ccf3901311661022a30afd60fc38130c9;p=ckeditor.git diff --git a/_source/plugins/panelbutton/plugin.js b/_source/plugins/panelbutton/plugin.js index 5821c88..44d5699 100644 --- a/_source/plugins/panelbutton/plugin.js +++ b/_source/plugins/panelbutton/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 */ @@ -17,7 +17,7 @@ CKEDITOR.plugins.add( 'panelbutton', * @constant * @example */ -CKEDITOR.UI_PANELBUTTON = 4; +CKEDITOR.UI_PANELBUTTON = 'panelbutton'; (function() { @@ -93,7 +93,7 @@ CKEDITOR.UI_PANELBUTTON = 4; return; var panelDefinition = this._.panelDefinition || {}, - panelBlockDefinition = this._.panelDefinition.block, + panelBlockDefinition = this._.panelDefinition.block, panelParentElement = panelDefinition.parent || CKEDITOR.document.getBody(), panel = this._.panel = new CKEDITOR.ui.floatPanel( editor, panelParentElement, panelDefinition ), block = panel.addBlock( _.id, panelBlockDefinition ), @@ -104,7 +104,6 @@ CKEDITOR.UI_PANELBUTTON = 4; if ( me.className ) this.element.getFirst().addClass( me.className + '_panel' ); - _.oldState = me._.state; me.setState( CKEDITOR.TRISTATE_ON ); _.on = 1; @@ -118,7 +117,7 @@ CKEDITOR.UI_PANELBUTTON = 4; if ( me.className ) this.element.getFirst().removeClass( me.className + '_panel' ); - me.setState( _.oldState ); + me.setState( me.modes && me.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED ); _.on = 0; @@ -136,10 +135,10 @@ CKEDITOR.UI_PANELBUTTON = 4; this.onBlock( panel, block ); block.onHide = function() - { - _.on = 0; - me.setState( CKEDITOR.TRISTATE_OFF ); - }; + { + _.on = 0; + me.setState( CKEDITOR.TRISTATE_OFF ); + }; } } });