Ticket #5674: 5674.patch

File 5674.patch, 1.3 KB (added by WebSpellChecker.net, 14 years ago)

add check of SCAYT control instance existing

  • _source/plugins/scayt/plugin.js

     
    155155                // Listen to data manipulation to reflect scayt markup.
    156156                editor.on( 'afterSetData', function()
    157157                        {
    158                                 if ( plugin.isScaytEnabled( editor ) ) {
    159                                         window.setTimeout( function(){ plugin.getScayt( editor ).refresh(); }, 10 );
    160                                 }
     158                                editor.fire('scaytRefresh');
    161159                        });
    162160
    163161                // Reload spell-checking for current word after insertion completed.
     
    173171
    174172                                        // Swallow any SCAYT engine errors.
    175173                                        window.setTimeout( function(){ scayt_instance.refresh(); }, 10 );
     174                                       
    176175                                }
    177176                        }, this, null, 50 );
    178177
     
    623622                                };
    624623
    625624                        editor.on( 'showScaytState', showInitialState );
     625                       
     626                        // Register SCAYT refresh event
     627                        editor.on( 'scaytRefresh', function(ev)
     628                                {
     629                                       
     630                                        CKEDITOR.tools.setTimeout(function()
     631                                        {
     632                                                var scayt_instance = plugin.getScayt(editor);
     633                                                if ( plugin.isScaytEnabled(editor) && scayt_instance  )
     634                                                {
     635                                                        scayt_instance.refresh();
     636                                                        console.info('refresh called')
     637                                                }
     638                                        },0);
     639                                });
    626640
    627641                        if ( CKEDITOR.env.opera )
    628642                        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy