Skip to content

Commit 194af13

Browse files
committed
fix minor bug
1 parent 77ac9af commit 194af13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/script.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ var loadFile = function (category, algorithm, file, explanation) {
4444
$('#explanation').html(explanation);
4545

4646
var dir = lastDir = './algorithm/' + category + '/' + algorithm + '/' + file + '/';
47-
loading = true;
4847
if (cachedFile[dir] && cachedFile[dir].data !== undefined && cachedFile[dir].code !== undefined) {
4948
dataEditor.setValue(cachedFile[dir].data, -1);
5049
codeEditor.setValue(cachedFile[dir].code, -1);
5150
} else {
51+
loading = true;
5252
cachedFile[dir] = {};
5353
dataEditor.setValue('');
5454
codeEditor.setValue('');
@@ -70,7 +70,7 @@ var loadFile = function (category, algorithm, file, explanation) {
7070
};
7171
var checkLoading = function () {
7272
if (loading) {
73-
showErrorToast('Wait until completes loading of previous file.');
73+
showErrorToast('Wait until it completes loading of previous file.');
7474
return true;
7575
}
7676
return false;

0 commit comments

Comments
 (0)