projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes
[vchess.git]
/
client
/
src
/
components
/
BaseGame.vue
diff --git
a/client/src/components/BaseGame.vue
b/client/src/components/BaseGame.vue
index
e02462e
..
630c838
100644
(file)
--- a/
client/src/components/BaseGame.vue
+++ b/
client/src/components/BaseGame.vue
@@
-93,6
+93,8
@@
export default {
document.getElementById("baseGame").focus();
},
handleKeys: function(e) {
document.getElementById("baseGame").focus();
},
handleKeys: function(e) {
+ if ([32,37,38,39,40].includes(e.keyCode))
+ e.preventDefault();
switch (e.keyCode)
{
case 37:
switch (e.keyCode)
{
case 37:
@@
-101,14
+103,13
@@
export default {
case 39:
this.play();
break;
case 39:
this.play();
break;
- case
2
8:
+ case
3
8:
this.gotoBegin();
break;
case 40:
this.gotoEnd();
break;
case 32:
this.gotoBegin();
break;
case 40:
this.gotoEnd();
break;
case 32:
- e.preventDefault();
this.flip();
break;
}
this.flip();
break;
}
@@
-324,8
+325,16
@@
export default {
},
gotoBegin: function() {
this.vr.re_init(this.game.fenStart);
},
gotoBegin: function() {
this.vr.re_init(this.game.fenStart);
- this.cursor = -1;
- this.lastMove = null;
+ if (this.moves.length > 0 && this.moves[0].notation == "...")
+ {
+ this.cursor = 0;
+ this.lastMove = this.moves[0];
+ }
+ else
+ {
+ this.cursor = -1;
+ this.lastMove = null;
+ }
},
gotoEnd: function() {
this.gotoMove(this.moves.length-1);
},
gotoEnd: function() {
this.gotoMove(this.moves.length-1);