Ticket #6812: 6812.patch

File 6812.patch, 1.4 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/scayt/plugin.js

     
    595595                                                label : lang.title,
    596596                                                title : CKEDITOR.env.opera ? lang.opera_title : lang.title,
    597597                                                className : 'cke_button_scayt',
     598                                                modes : { wysiwyg : 1 },
    598599                                                onRender: function()
    599600                                                {
    600601                                                        command.on( 'state', function()
  • _source/plugins/button/plugin.js

     
    137137
    138138                instance.index = index = CKEDITOR.ui.button._.instances.push( instance ) - 1;
    139139
     140                // Indicate a mode sensitive button.
    140141                if ( this.modes )
    141142                {
     143                        var modeStates = {};
     144
     145                        editor.on( 'beforeModeUnload', function()
     146                                {
     147                                        modeStates[ editor.mode ] = this._.state;
     148                                }, this );
     149
    142150                        editor.on( 'mode', function()
    143151                                {
    144                                         this.setState( this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
     152                                        var mode = editor.mode;
     153
     154                                        // Restore saved button state.
     155                                        this.setState( this.modes[ mode ] ? modeStates[ mode ] != undefined ? modeStates[ mode ] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
    145156                                }, this);
    146157                }
    147158                else if ( command )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy