Remove AutoSave Function on Submit

Remove automatic save function on submit of form to stop MDE resaving
the value as the submit is still occurring.
This stops the already submitted value being redisplayed on load which
improves the end user experience.
pull/266/head
Andrew Rawlinson-Bennett 8 years ago
parent d77d4b318b
commit 1c68f2c681

@ -1521,6 +1521,11 @@ SimpleMDE.prototype.autosave = function() {
if(simplemde.element.form != null && simplemde.element.form != undefined) {
simplemde.element.form.addEventListener("submit", function() {
/**
* Remove the autosave function to stop resaving the MDE after the
* submit has been started.
*/
SimpleMDE.prototype.autosave = function(){};
localStorage.removeItem("smde_" + simplemde.options.autosave.uniqueId);
});
}

Loading…
Cancel
Save