Kill form submission during autosave.

git-svn-id: https://develop.svn.wordpress.org/trunk@4507 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-11-21 01:39:09 +00:00
parent 6d3ce02732
commit 314a957940

View File

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