mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
Merge ba403ebfa2fab1c1e39d7b0827762da5d621bd0f into e32fe3f91c2d45f27f72a3662133b1c0e1a5bda1
This commit is contained in:
commit
c668360ea6
@ -16623,10 +16623,12 @@ SimpleMDE.prototype.autosave = function() {
|
||||
return;
|
||||
}
|
||||
|
||||
if(simplemde.element.form != null && simplemde.element.form != undefined) {
|
||||
if(this.element.form != null && this.element.form != undefined && !this.options.autosave.isEventListening) {
|
||||
simplemde.element.form.addEventListener("submit", function() {
|
||||
localStorage.removeItem("smde_" + simplemde.options.autosave.uniqueId);
|
||||
simplemde.options.autosave.stop = true;
|
||||
});
|
||||
this.options.autosave.isEventListening = true;
|
||||
}
|
||||
|
||||
if(this.options.autosave.loaded !== true) {
|
||||
@ -16638,6 +16640,9 @@ SimpleMDE.prototype.autosave = function() {
|
||||
this.options.autosave.loaded = true;
|
||||
}
|
||||
|
||||
if (this.options.autosave.stop)
|
||||
return;
|
||||
|
||||
localStorage.setItem("smde_" + this.options.autosave.uniqueId, simplemde.value());
|
||||
|
||||
var el = document.getElementById("autosaved");
|
||||
|
@ -16620,10 +16620,12 @@ SimpleMDE.prototype.autosave = function() {
|
||||
return;
|
||||
}
|
||||
|
||||
if(simplemde.element.form != null && simplemde.element.form != undefined) {
|
||||
if(this.element.form != null && this.element.form != undefined && !this.options.autosave.isEventListening) {
|
||||
simplemde.element.form.addEventListener("submit", function() {
|
||||
localStorage.removeItem("smde_" + simplemde.options.autosave.uniqueId);
|
||||
simplemde.options.autosave.stop = true;
|
||||
});
|
||||
this.options.autosave.isEventListening = true;
|
||||
}
|
||||
|
||||
if(this.options.autosave.loaded !== true) {
|
||||
@ -16635,6 +16637,9 @@ SimpleMDE.prototype.autosave = function() {
|
||||
this.options.autosave.loaded = true;
|
||||
}
|
||||
|
||||
if (this.options.autosave.stop)
|
||||
return;
|
||||
|
||||
localStorage.setItem("smde_" + this.options.autosave.uniqueId, simplemde.value());
|
||||
|
||||
var el = document.getElementById("autosaved");
|
||||
|
@ -1601,10 +1601,12 @@ SimpleMDE.prototype.autosave = function() {
|
||||
return;
|
||||
}
|
||||
|
||||
if(simplemde.element.form != null && simplemde.element.form != undefined) {
|
||||
if(this.element.form != null && this.element.form != undefined && !this.options.autosave.isEventListening) {
|
||||
simplemde.element.form.addEventListener("submit", function() {
|
||||
localStorage.removeItem("smde_" + simplemde.options.autosave.uniqueId);
|
||||
simplemde.options.autosave.stop = true;
|
||||
});
|
||||
this.options.autosave.isEventListening = true;
|
||||
}
|
||||
|
||||
if(this.options.autosave.loaded !== true) {
|
||||
@ -1616,6 +1618,9 @@ SimpleMDE.prototype.autosave = function() {
|
||||
this.options.autosave.loaded = true;
|
||||
}
|
||||
|
||||
if (this.options.autosave.stop)
|
||||
return;
|
||||
|
||||
localStorage.setItem("smde_" + this.options.autosave.uniqueId, simplemde.value());
|
||||
|
||||
var el = document.getElementById("autosaved");
|
||||
|
Loading…
x
Reference in New Issue
Block a user