Ticket #5720: 5720.patch
File 5720.patch, 1.2 KB (added by , 14 years ago) |
---|
-
_source/plugins/scayt/plugin.js
13 13 var commandName = 'scaytcheck', 14 14 openPage = '', 15 15 scayt_paused = null, 16 scayt_control_id = null; 16 scayt_control_id = null, 17 is_control_restored = false; 17 18 18 19 // Checks if a value exists in an array 19 20 function in_array(needle, haystack) … … 55 56 this.addStyle( this.selectorCss(), 'padding-bottom: 2px !important;' ); 56 57 57 58 // 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) 60 61 this.focus(); 61 62 62 63 }; … … 146 147 delete plugin.instances[ editor.name ]; 147 148 } 148 149 } 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 } 149 155 }); 150 156 151 157 editor.on( 'afterCommandExec', function( ev )