From 3bc4dbb765fe8271d77307dcfb99cb0a92a7cfe3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Jul 2015 02:13:54 -0400 Subject: [PATCH] fixed animation --- clashingcomrades/static/main.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clashingcomrades/static/main.js b/clashingcomrades/static/main.js index 9f82074..43e6a0e 100644 --- a/clashingcomrades/static/main.js +++ b/clashingcomrades/static/main.js @@ -103,15 +103,14 @@ function tableCreate() { } function tableUpdate (coordinate, team) { - current = table.rows[coordinate[0]].cells[coordinate[1]]; - current.className = "player "; - current.className += team; - current.style.backgroundColor = playerColors[team]; + table.rows[coordinate[0]].cells[coordinate[1]].className = "player "; + table.rows[coordinate[0]].cells[coordinate[1]].className += team; + table.rows[coordinate[0]].cells[coordinate[1]].style.backgroundColor = playerColors[team]; } function oldTableUpdate(coordinate, team) { - current.className = current.className.replace("player ", ""); - current.style.backgroundColor = claimedColors[team]; + table.rows[coordinate[0]].cells[coordinate[1]].className = table.rows[coordinate[0]].cells[coordinate[1]].className.replace("player ", ""); + table.rows[coordinate[0]].cells[coordinate[1]].style.backgroundColor = claimedColors[team]; } // Creation of Player