document.getElementById("baseGame").focus();
},
handleKeys: function(e) {
+ if ([32,37,38,39,40].includes(e.keyCode))
+ e.preventDefault();
switch (e.keyCode)
{
case 37:
case 39:
this.play();
break;
- case 28:
+ case 38:
this.gotoBegin();
break;
case 40:
this.gotoEnd();
break;
case 32:
- e.preventDefault();
this.flip();
break;
}
},
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);
option(value="2") {{ st.tr["All"] }}
fieldset
.slidecontainer
- input#myRange.slider(type="range" min="10" max="100" value="55"
+ input#myRange.slider(type="range" min="20" max="100" value="60"
@input="adjustBoard")
</template>
return {
st: store.state,
};
+ },
+ mounted: function() {
+ const boardSize = localStorage.getItem("boardSize");
+ if (!!boardSize)
+ document.getElementById("myRange").value = Math.floor(boardSize / 10);
},
methods: {
updateSettings: function(event) {