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:
parent
f336d22da7
commit
29cb9128a7
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue