Ticket #5720: 5720_2.patch

File 5720_2.patch, 1.6 KB (added by WebSpellChecker.net, 14 years ago)
  • _source/plugins/scayt/plugin.js

     
    5555                                                this.addStyle( this.selectorCss(), 'padding-bottom: 2px !important;' );
    5656
    5757                                        // Call scayt_control.focus when SCAYT loaded
    58                                         // and only if editor has focus
    59                                         if ( editor.focusManager.hasFocus )
     58                                        // and only if editor has focus and scayt control creates at first time (5720 ticket)
     59                                        if ( editor.focusManager.hasFocus && !plugin.isControlRestored( editor ) )
    6060                                                this.focus();
    6161
    6262                                };
     
    146146                                                delete plugin.instances[ editor.name ];
    147147                                        }
    148148                                }
     149                                // Catch on source mode switch off (5720 ticket)
     150                                else if ( ev.data.name == 'source'  && editor.mode == 'source' )
     151                                {
     152                                        plugin.markControlRestore( editor )
     153                                }
    149154                        });
    150155
    151156                editor.on( 'afterCommandExec', function( ev )
     
    281286        {
    282287                engineLoaded : false,
    283288                instances : {},
     289                controlInfo : {},
     290                isControlRestored : function ( editor ){
     291                        return this.controlInfo[editor.name] && this.controlInfo[editor.name].restored ;
     292                },
     293                markControlRestore : function ( editor ){
     294                        this.controlInfo[editor.name] = {};
     295                        this.controlInfo[editor.name].restored = true;
     296                },
    284297                getScayt : function( editor )
    285298                {
    286299                        return this.instances[ editor.name ];
     
    739752                                elementsPathFilters.push( scaytFilter );
    740753
    741754                        editor.addRemoveFormatFilter && editor.addRemoveFormatFilter( scaytFilter );
    742 
     755                       
    743756                }
    744757        });
    745758})();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy