2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-13 13:04:27 -06:00

Fix autosave briefly losing saved value

This commit is contained in:
Wes Cossick 2015-11-16 00:01:44 -06:00
parent 69e65ac0d1
commit 90733ec404

View File

@ -994,7 +994,6 @@ SimpleMDE.prototype.render = function(el) {
};
SimpleMDE.prototype.autosave = function() {
var content = this.value();
var simplemde = this;
if(this.options.autosave.unique_id == undefined || this.options.autosave.unique_id == "") {
@ -1016,7 +1015,7 @@ SimpleMDE.prototype.autosave = function() {
}
if(localStorage) {
localStorage.setItem(this.options.autosave.unique_id, content);
localStorage.setItem(this.options.autosave.unique_id, simplemde.value());
}
var el = document.getElementById("autosaved");