Ticket #5720: 5720_2.patch
File 5720_2.patch, 1.6 KB (added by , 14 years ago) |
---|
-
_source/plugins/scayt/plugin.js
55 55 this.addStyle( this.selectorCss(), 'padding-bottom: 2px !important;' ); 56 56 57 57 // 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 ) ) 60 60 this.focus(); 61 61 62 62 }; … … 146 146 delete plugin.instances[ editor.name ]; 147 147 } 148 148 } 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 } 149 154 }); 150 155 151 156 editor.on( 'afterCommandExec', function( ev ) … … 281 286 { 282 287 engineLoaded : false, 283 288 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 }, 284 297 getScayt : function( editor ) 285 298 { 286 299 return this.instances[ editor.name ]; … … 739 752 elementsPathFilters.push( scaytFilter ); 740 753 741 754 editor.addRemoveFormatFilter && editor.addRemoveFormatFilter( scaytFilter ); 742 755 743 756 } 744 757 }); 745 758 })();