projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add unambiguous section in the PGN + some fixes + code formatting and fix typos
[vchess.git]
/
client
/
src
/
components
/
MoveList.vue
diff --git
a/client/src/components/MoveList.vue
b/client/src/components/MoveList.vue
index
6e3a90d
..
91d138e
100644
(file)
--- a/
client/src/components/MoveList.vue
+++ b/
client/src/components/MoveList.vue
@@
-27,6
+27,12
@@
div
:aria-label="st.tr['Resize board']"
)
img.inline(src="/images/icons/resize.svg")
:aria-label="st.tr['Resize board']"
)
img.inline(src="/images/icons/resize.svg")
+ button.tooltip(
+ v-if="canAnalyze"
+ @click="$emit('analyze')"
+ :aria-label="st.tr['Analyse']"
+ )
+ img.inline(src="/images/icons/analyse.svg")
#downloadDiv(v-if="canDownload")
a#download(href="#")
button.tooltip(
#downloadDiv(v-if="canDownload")
a#download(href="#")
button.tooltip(
@@
-34,12
+40,6
@@
div
:aria-label="st.tr['Download'] + ' PGN'"
)
img.inline(src="/images/icons/download.svg")
:aria-label="st.tr['Download'] + ' PGN'"
)
img.inline(src="/images/icons/download.svg")
- button.tooltip(
- v-if="canAnalyze"
- @click="$emit('analyze')"
- :aria-label="st.tr['Analyse']"
- )
- img.inline(src="/images/icons/analyse.svg")
#scoreInfo(v-if="score!='*'")
span.score {{ score }}
span.score-msg {{ st.tr[message] }}
#scoreInfo(v-if="score!='*'")
span.score {{ score }}
span.score-msg {{ st.tr[message] }}
@@
-53,7
+53,7
@@
div
| {{ notation(moves[moveIdx]) }}
.td(
v-if="moveIdx < moves.length-1"
| {{ notation(moves[moveIdx]) }}
.td(
v-if="moveIdx < moves.length-1"
- :class="{'highlight-lm':
cursor == moveIdx+1
}"
+ :class="{'highlight-lm':
highlightBlackmove(moveIdx)
}"
@click="() => gotoMove(moveIdx+1)"
)
| {{ notation(moves[moveIdx+1]) }}
@click="() => gotoMove(moveIdx+1)"
)
| {{ notation(moves[moveIdx+1]) }}
@@
-74,12
+74,11
@@
export default {
};
},
mounted: function() {
};
},
mounted: function() {
- document.getElementById("adjuster").addEventListener(
- "click",
- processModalClick);
+ document.getElementById("adjuster")
+ .addEventListener("click", processModalClick);
if ("ontouchstart" in window) {
// Disable tooltips on smartphones:
if ("ontouchstart" in window) {
// Disable tooltips on smartphones:
- document.
getElementsByClassName("
tooltip").forEach(elt => {
+ document.
querySelectorAll("#aboveMoves .
tooltip").forEach(elt => {
elt.classList.remove("tooltip");
});
}
elt.classList.remove("tooltip");
});
}
@@
-115,9
+114,11
@@
export default {
// $nextTick to wait for table > tr to be rendered
this.$nextTick(() => {
let curMove = document.querySelector(".td.highlight-lm");
// $nextTick to wait for table > tr to be rendered
this.$nextTick(() => {
let curMove = document.querySelector(".td.highlight-lm");
- if (!curMove && this.moves.length > 0)
+ if (!curMove && this.moves.length > 0)
{
// Cursor is before game beginning, and some moves were made:
// Cursor is before game beginning, and some moves were made:
- curMove = document.querySelector(".moves-list > .tr:first-child > .td");
+ curMove =
+ document.querySelector(".moves-list > .tr:first-child > .td");
+ }
if (!!curMove) {
curMove.scrollIntoView({
behavior: "auto",
if (!!curMove) {
curMove.scrollIntoView({
behavior: "auto",
@@
-136,6
+137,12
@@
export default {
notation: function(move) {
return getFullNotation(move);
},
notation: function(move) {
return getFullNotation(move);
},
+ highlightBlackmove: function(moveIdx) {
+ return (
+ this.cursor == moveIdx + 1 ||
+ (this.show == "byrow" && this.cursor == moveIdx + 2)
+ );
+ },
gotoMove: function(index) {
this.$emit("goto-move", index);
},
gotoMove: function(index) {
this.$emit("goto-move", index);
},
@@
-160,6
+167,7
@@
export default {
<style lang="sass" scoped>
.moves-list
<style lang="sass" scoped>
.moves-list
+ user-select: none
cursor: pointer
min-height: 1px
max-height: 500px
cursor: pointer
min-height: 1px
max-height: 500px
@@
-193,7
+201,7
@@
export default {
padding: 5px
img.inline
padding: 5px
img.inline
- height: 2
4
px
+ height: 2
2
px
@media screen and (max-width: 767px)
height: 18px
@media screen and (max-width: 767px)
height: 18px
@@
-225,6
+233,6
@@
span#rulesBtn
button
margin: 0
button
margin: 0
-button.tooltip
+#aboveMoves button
padding-bottom: 5px
</style>
padding-bottom: 5px
</style>