projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove watcher for fenStart in BaseGame: call re_setVariables manually. Less Vue...
[vchess.git]
/
client
/
src
/
views
/
Problems.vue
diff --git
a/client/src/views/Problems.vue
b/client/src/views/Problems.vue
index
ef05e12
..
3b53a1a
100644
(file)
--- a/
client/src/views/Problems.vue
+++ b/
client/src/views/Problems.vue
@@
-97,6
+97,7
@@
main
td {{ firstChars(p.instruction) }}
td {{ p.id }}
BaseGame(
td {{ firstChars(p.instruction) }}
td {{ p.id }}
BaseGame(
+ ref="basegame"
v-if="showOne"
:game="game"
)
v-if="showOne"
:game="game"
)
@@
-162,7
+163,7
@@
export default {
});
const showOneIfPid = () => {
const pid = this.$route.query["id"];
});
const showOneIfPid = () => {
const pid = this.$route.query["id"];
- if (pid) this.showProblem(this.problems.find(p => p.id == pid));
+ if (
!!
pid) this.showProblem(this.problems.find(p => p.id == pid));
};
if (Object.keys(names).length > 0) {
ajax(
};
if (Object.keys(names).length > 0) {
ajax(
@@
-188,8
+189,7
@@
export default {
);
},
mounted: function() {
);
},
mounted: function() {
- document
- .getElementById("newprobDiv")
+ document.getElementById("newprobDiv")
.addEventListener("click", processModalClick);
},
watch: {
.addEventListener("click", processModalClick);
},
watch: {
@@
-201,7
+201,7
@@
export default {
},
$route: function(to) {
const pid = to.query["id"];
},
$route: function(to) {
const pid = to.query["id"];
- if (pid) this.showProblem(this.problems.find(p => p.id == pid));
+ if (
!!
pid) this.showProblem(this.problems.find(p => p.id == pid));
else this.showOne = false;
}
},
else this.showOne = false;
}
},
@@
-299,10
+299,13
@@
export default {
// The FEN is already checked at this stage:
this.game.vname = p.vname;
this.game.mycolor = V.ParseFen(p.fen).turn; //diagram orientation
// The FEN is already checked at this stage:
this.game.vname = p.vname;
this.game.mycolor = V.ParseFen(p.fen).turn; //diagram orientation
+ this.game.fenStart = p.fen;
this.game.fen = p.fen;
this.game.fen = p.fen;
- this.$set(this.game, "fenStart", p.fen);
- this.copyProblem(p, this.curproblem);
this.showOne = true;
this.showOne = true;
+ // $nextTick to be sure $refs["basegame"] exists
+ this.$nextTick(() => {
+ this.$refs["basegame"].re_setVariables(this.game); });
+ this.copyProblem(p, this.curproblem);
});
},
gotoPrevNext: function(e, prob, dir) {
});
},
gotoPrevNext: function(e, prob, dir) {