Ticket #5720: 5720.patch

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

     
    1313        var commandName         = 'scaytcheck',
    1414                openPage                = '',
    1515                scayt_paused    = null,
    16                 scayt_control_id = null;
     16                scayt_control_id = null,
     17                is_control_restored = false;
    1718
    1819        // Checks if a value exists in an array
    1920        function in_array(needle, haystack)
     
    5556                                                this.addStyle( this.selectorCss(), 'padding-bottom: 2px !important;' );
    5657
    5758                                        // Call scayt_control.focus when SCAYT loaded
    58                                         // and only if editor has focus
    59                                         if ( editor.focusManager.hasFocus )
     59                                        // and only if editor has focus and scayt control creates at first time (5720 ticket)
     60                                        if (editor.focusManager.hasFocus && !is_control_restored)
    6061                                                this.focus();
    6162
    6263                                };
     
    146147                                                delete plugin.instances[ editor.name ];
    147148                                        }
    148149                                }
     150                                // Catch on source mode switch off (5720 ticket)
     151                                else if ( ev.data.name == 'source'  && editor.mode == 'source' )
     152                                {
     153                                        is_control_restored = true;
     154                                }
    149155                        });
    150156
    151157                editor.on( 'afterCommandExec', function( ev )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy