Kill form submission during autosave.

git-svn-id: http://svn.automattic.com/wordpress/trunk@4507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-11-21 01:39:09 +00:00
parent f336d22da7
commit 29cb9128a7
1 changed files with 6 additions and 4 deletions

View File

@ -9,11 +9,13 @@ function autosave_start_timer() {
autosaveLast = form.post_title.value+form.content.value;
autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '16'); ?>);
//Disable autosave after the form has been submitted
// if(form.addEventListener) {
// form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false);
// }
if(form.addEventListener) {
form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false);
}
if(form.attachEvent) {
form.attachEvent("onsubmit", function () { autosavePeriodical.currentlyExecuting = true; });
$('save').attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; });
$('publish').attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; });
$('deletepost').attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; });
}
}
addLoadEvent(autosave_start_timer)