Fix autosave briefly losing saved value

pull/182/head
Wes Cossick 9 years ago
parent 69e65ac0d1
commit 90733ec404

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

Loading…
Cancel
Save