This commit is contained in:
Kyle
2019-08-10 16:15:59 -07:00
parent d7b54a253b
commit b3c658ea0b
2 changed files with 13 additions and 13 deletions

View File

@@ -143,16 +143,16 @@ function playerBox(playerBoxID, canvasRotation, wide) {
this.canvas.classList.add("widePlayerBox") this.canvas.classList.add("widePlayerBox")
} }
document.getElementById("mainGrid").appendChild(this.canvas) document.getElementById("mainGrid").appendChild(this.canvas)
this.canvas.addEventListener("mousedown", function() { this.canvas.addEventListener("mousedown", decoyMouseDownFunction)
mouseDownPlayerBox(this, event.clientX, event.clientY) document.addEventListener("mouseup", decoyMouseUpFunction)
alert("It's still clicking!") window.addEventListener("touchstart", switchToTouchEvents)
}) }
document.addEventListener("mouseup", function() { function decoyMouseDownFunction() {
mouseUpPlayerBox(this) alert("IT'S STILL CLICKING")
}) mouseDownPlayerBox(this, event.clientX, event.clientY)
window.addEventListener("touchstart", function() { }
switchToTouchEvents() function decoyMouseUpFunction() {
}) mouseUpPlayerBox(this)
} }
function configurePlayerBox(playerBoxID) { function configurePlayerBox(playerBoxID) {
var currentPlayer = playerList[playerBoxID - 1] var currentPlayer = playerList[playerBoxID - 1]
@@ -224,8 +224,8 @@ function updateBackgroundColor(color) {
function switchToTouchEvents() { function switchToTouchEvents() {
document.removeEventListener("mousedown") document.removeEventListener("mousedown", decoyMouseDownFunction)
document.removeEventListener("mouseup") document.removeEventListener("mouseup", decoyMouseUpFunction)
document.addEventListener("touchstart", function() { document.addEventListener("touchstart", function() {
mouseDownPlayerBox(this, event.clientX, event.clientY) mouseDownPlayerBox(this, event.clientX, event.clientY)
}) })

View File

@@ -197,7 +197,7 @@
margin: 90pt 0px 0px 0px; margin: 90pt 0px 0px 0px;
padding: 20pt; padding: 20pt;
overflow-y: scroll; overflow-y: scroll;
max-height: calc(100% - 90pt); height: calc(100% - 90pt);
border: 1px solid white; border: 1px solid white;
} }
.menuOption { .menuOption {