git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
word/quiz: dynamic lang(uage) option
[sheet.git]
/
word
/
memory.js
diff --git
a/word/memory.js
b/word/memory.js
index dfbb8a65b2b4dcdc22995701b26229a33de6757f..99e76e87ad66cec3e9d757f5b234ce68bacfc996 100644
(file)
--- a/
word/memory.js
+++ b/
word/memory.js
@@
-41,17
+41,17
@@
class WordMemory extends WordQuiz {
.forEach(card => put(card, '!.turn!.bad'));
}
.forEach(card => put(card, '!.turn!.bad'));
}
- load(dataurl) {
- if (dataurl) {
- super.load(dataurl);
- }
- else {
+ load() {
+ if (this.preset.pairs) {
this.dataurl = '/data/wordpairs.json';
fetch(this.dataurl).then(res => res.json()).then(pairs => {
this.pairs = pairs;
this.setup();
});
}
this.dataurl = '/data/wordpairs.json';
fetch(this.dataurl).then(res => res.json()).then(pairs => {
this.pairs = pairs;
this.setup();
});
}
+ else {
+ super.load();
+ }
}
setup() {
}
setup() {