From 90733ec404a99cc00a5cc33a0c2f3470603e8203 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Mon, 16 Nov 2015 00:01:44 -0600 Subject: [PATCH] Fix autosave briefly losing saved value --- src/js/simplemde.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/simplemde.js b/src/js/simplemde.js index e05b31b..c473c02 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -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");