From c34d99529bbfe5de7daa8d23c8c4c5938191a2d6 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Sat, 21 May 2016 19:13:40 -0500 Subject: [PATCH] fix minor bug --- js/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index e2df854..d42624f 100644 --- a/js/script.js +++ b/js/script.js @@ -46,10 +46,11 @@ var loadFile = function (category, algorithm, file, explanation) { dataEditor.setValue(cachedFile[dir].data, -1); codeEditor.setValue(cachedFile[dir].code, -1); } else { + cachedFile[dir] = {}; dataEditor.setValue(''); codeEditor.setValue(''); $.get(dir + 'data.js', function (data) { - cachedFile[dir] = {data: data}; + cachedFile[dir].data = data; dataEditor.setValue(data, -1); $.get(dir + 'code.js', function (code) { -- GitLab