From ce5f66413ef14debabc2ac47b5a99ebcf1a7db3a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 2 Oct 2016 10:41:44 -0400 Subject: [PATCH] Add restart button --- js/type.js | 18 ++++++++++++++++++ type.html | 1 + 2 files changed, 19 insertions(+) diff --git a/js/type.js b/js/type.js index db2978b..21fd193 100644 --- a/js/type.js +++ b/js/type.js @@ -65,6 +65,24 @@ themeSelector.change(() => { save(); }); +// restart button +$("#restart").click(() => { + localforage.getItem(repo) + .then((val) => { + val[filePath] = {}; + localforage.setItem(repo, val) + .then(() => { + window.location.reload(); + }) + .catch((e) => { + throw e; + }); + }) + .catch((e) => { + throw e; + }); +}); + // setup function setup(data, mime) { let el = document.getElementById("editor"); diff --git a/type.html b/type.html index 814caec..6f5abee 100644 --- a/type.html +++ b/type.html @@ -15,6 +15,7 @@
+