From 76f60e7c2ab738c5089e6fd8e45dddd1b4d0045e Mon Sep 17 00:00:00 2001 From: Elijah Steres Date: Wed, 30 Dec 2020 21:42:07 -0500 Subject: [PATCH] clean up code --- static/loader.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/static/loader.js b/static/loader.js index ab6124f..3872d6f 100644 --- a/static/loader.js +++ b/static/loader.js @@ -39,18 +39,13 @@ $(document).ready(function (){ }; }; - var requiredcells = Math.max(4, (3 * Math.ceil(Object.keys(json).length/3))+1); - for (var slotnum = 1; slotnum < grid.children.length; slotnum++) { if (grid.children[slotnum].className == "game" && !(Object.keys(json).includes(grid.children[slotnum].timestamp))) { grid.removeChild(grid.children[slotnum]); } } - - console.log(Object.keys(json).length) - console.log(requiredcells) - console.log(grid.children.length) + var requiredcells = Math.max(4, (3 * Math.ceil(Object.keys(json).length/3))+1); while (grid.children.length > requiredcells) { grid.removeChild(grid.children[requiredcells]);