Ticket #5674: 5674_3.patch

File 5674_3.patch, 1.2 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/scayt/plugin.js

     
    5757
    5858                        oParams.onBeforeChange = function()
    5959                        {
    60                                 if ( !editor.checkDirty() )
     60                                if ( plugin.getScayt( editor ) && !editor.checkDirty() )
    6161                                        setTimeout( function(){ editor.resetDirty(); } );
    6262                        };
    6363                       
     
    155155                        {
    156156                                var editor = ev.editor,
    157157                                        scayt_instance = plugin.getScayt( editor );
     158                                delete plugin.instances[ editor.name ];
    158159                                // store a control id for restore a specific scayt control settings
    159160                                scayt_control_id = scayt_instance.id;
    160161                                scayt_instance.destroy( true );
    161                                 delete plugin.instances[ editor.name ];
    162162                        });
    163163
    164164                // Listen to data manipulation to reflect scayt markup.
    165165                editor.on( 'afterSetData', function()
    166166                        {
    167167                                if ( plugin.isScaytEnabled( editor ) ) {
    168                                         window.setTimeout( function(){ plugin.getScayt( editor ).refresh(); }, 10 );
     168                                        window.setTimeout( function()
     169                                                {
     170                                                        var instance = plugin.getScayt( editor );
     171                                                        instance && instance.refresh();
     172                                                }, 10 );
    169173                                }
    170174                        });
    171175
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy