X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=26c54719836e665400129621873e5f360b75d0c8;hp=290897c0962177bfcd6ff9f2599773c88f989027;hb=4665d3c6b2d9a7d1f1254690e63531a45f2305a4;hpb=c350b3e525b72509a4b717a513ccaa596f1fc515 diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 290897c0..26c54719 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -81,7 +81,7 @@ export default { // Take full width on small screens: let boardSize = window.innerWidth >= 768 - ? 0.75 * Math.min(window.innerWidth, window.innerHeight) + ? 0.7 * Math.min(window.innerWidth, window.innerHeight) : window.innerWidth; const movesWidth = window.innerWidth >= 768 ? 280 : 0; document.getElementById("boardContainer").style.width = boardSize + "px"; @@ -89,10 +89,12 @@ export default { gameContainer.style.width = boardSize + movesWidth + "px"; document.getElementById("boardSize").value = (boardSize * 100) / (window.innerWidth - movesWidth); - window.addEventListener("resize", this.adjustBoard); - // TODO: find sometjhing better than next height adjustment... - // maybe each variant could give its ratio (?!) - setTimeout( () => { this.adjustBoard("vertical"); }, 1000); + window.addEventListener("resize", () => this.adjustBoard()); + if ("ontouchstart" in window) { + // TODO: find something better than next height adjustment... + // maybe each variant could give its ratio (?!) + setTimeout( () => { this.adjustBoard("vertical"); }, 1000); + } }, beforeDestroy: function() { window.removeEventListener("resize", this.adjustBoard);