Ticket #6812: 6812_2.patch

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

     
    9898
    9999                instance.index = index = CKEDITOR.ui.button._.instances.push( instance ) - 1;
    100100
     101                // Indicate a mode sensitive button.
    101102                if ( this.modes )
    102103                {
     104                        var modeStates = {};
     105                        editor.on( 'beforeModeUnload', function()
     106                                {
     107                                        modeStates[ editor.mode ] = this._.state;
     108                                }, this );
     109
    103110                        editor.on( 'mode', function()
    104111                                {
    105112                                        this.setState( this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
     113                                        var mode = editor.mode;
     114                                        // Restore saved button state.
     115                                        this.setState( this.modes[ mode ] ?
     116                                                modeStates[ mode ] != undefined ? modeStates[ mode ] :
     117                                                        CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
    106118                                }, this);
    107119                }
    108120                else if ( command )
  • _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()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy