Ticket #5674: 5674_3.patch
File 5674_3.patch, 1.2 KB (added by , 13 years ago) |
---|
-
_source/plugins/scayt/plugin.js
57 57 58 58 oParams.onBeforeChange = function() 59 59 { 60 if ( !editor.checkDirty() )60 if ( plugin.getScayt( editor ) && !editor.checkDirty() ) 61 61 setTimeout( function(){ editor.resetDirty(); } ); 62 62 }; 63 63 … … 155 155 { 156 156 var editor = ev.editor, 157 157 scayt_instance = plugin.getScayt( editor ); 158 delete plugin.instances[ editor.name ]; 158 159 // store a control id for restore a specific scayt control settings 159 160 scayt_control_id = scayt_instance.id; 160 161 scayt_instance.destroy( true ); 161 delete plugin.instances[ editor.name ];162 162 }); 163 163 164 164 // Listen to data manipulation to reflect scayt markup. 165 165 editor.on( 'afterSetData', function() 166 166 { 167 167 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 ); 169 173 } 170 174 }); 171 175