Ticket #3562: 3562_3.patch

File 3562_3.patch, 1.7 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/scayt/plugin.js

     
    6868                        {
    6969                                if ( ev.data.name == 'source' && editor.mode == 'wysiwyg' )
    7070                                {
    71                                         var scayt = plugin.getScayt( editor );
    72                                         if ( scayt )
     71                                        var instance = plugin.getScayt( editor )
     72                                        if ( instance )
    7373                                        {
    74                                                 scayt.paused = !scayt.disabled;
    75                                                 scayt.setDisabled( true );
     74                                                instance.paused = !instance.disabled;
     75                                                instance.setDisabled( true );
    7676                                        }
    7777                                }
    7878                        });
     
    8484                                        plugin.getScayt( editor ).refresh();
    8585                        });
    8686
     87                // Reload spell-checking for current word after insertion completed.
     88                editor.on( 'insertElement', function()
     89                        {
     90                                var instance = plugin.getScayt( editor );
     91                                if ( plugin.isScaytEnabled( editor ) )
     92                                {
     93                                        // Unlock the selection before reload, SCAYT will take
     94                                        // care selection update.
     95                                        if ( CKEDITOR.env.ie )
     96                                                editor.getSelection().unlock( true );
     97
     98                                        // Swallow any SCAYT engine errors.
     99                                        try{
     100                                                instance.reset();
     101                                                instance.setDisabled( false );
     102                                        }catch( er )
     103                                        {}
     104                                }
     105                        }, this, null, 50 );
     106
    87107                editor.on( 'scaytDialog', function( ev )        // Communication with dialog.
    88108                        {
    89109                                ev.data.djConfig = djConfig;
     
    133153                },
    134154                isScaytEnabled : function( editor )
    135155                {
    136                         var scayt = this.getScayt( editor );
    137                         return ( scayt ) ? scayt.disabled === false : false;
     156                        var instance = this.getScayt( editor );
     157                        return ( instance ) ? instance.disabled === false : false;
    138158                },
    139159                loadEngine : function( editor )
    140160                {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy