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:
parent
6d3ce02732
commit
314a957940
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user