projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Attempt to fix promotions on mobile browsers
[vchess.git]
/
client
/
src
/
components
/
Board.vue
diff --git
a/client/src/components/Board.vue
b/client/src/components/Board.vue
index
5080e84
..
f2fd44c
100644
(file)
--- a/
client/src/components/Board.vue
+++ b/
client/src/components/Board.vue
@@
-294,7
+294,16
@@
export default {
}
},
this.choices.map(m => {
}
},
this.choices.map(m => {
- //a "choice" is a move
+ // A "choice" is a move
+ const applyMove = (e) => {
+ e.stopPropagation();
+ this.play(m);
+ this.choices = [];
+ };
+ const onClick =
+ this.mobileBrowser
+ ? { touchend: applyMove }
+ : { mouseup: applyMove };
return h(
"div",
{
return h(
"div",
{
@@
-316,12
+325,7
@@
export default {
".svg"
},
class: { "choice-piece": true },
".svg"
},
class: { "choice-piece": true },
- on: {
- click: () => {
- this.play(m);
- this.choices = [];
- }
- }
+ on: onClick
})
]
);
})
]
);