diff --git a/wp-includes/js/autosave.js.php b/wp-includes/js/autosave.js.php index a8648f0118..155408a606 100644 --- a/wp-includes/js/autosave.js.php +++ b/wp-includes/js/autosave.js.php @@ -2,15 +2,11 @@ cache_javascript_headers(); ?> var autosaveLast = ''; -function autosave_timer() { - autosave(); - setTimeout("autosave_timer()", ); -} - +var autosavePeriodical; function autosave_start_timer() { var form = $('post'); autosaveLast = form.post_title.value+form.content.value; - setTimeout("autosave_timer()", ); + autosavePerodical = new PeriodicalExecutor(autosave, ); } addLoadEvent(autosave_start_timer) @@ -80,6 +76,7 @@ function autosave() { if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) { autosaveAjax.setVar("content", form.content.value); } else { + // Don't run while the TinyMCE spellcheck is on. if(tinyMCE.selectedInstance.spellcheckerOn) return; tinyMCE.wpTriggerSave(); autosaveAjax.setVar("content", form.content.value);