clean up code
This commit is contained in:
parent
40e1c5a72c
commit
76f60e7c2a
|
@ -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++) {
|
for (var slotnum = 1; slotnum < grid.children.length; slotnum++) {
|
||||||
if (grid.children[slotnum].className == "game" && !(Object.keys(json).includes(grid.children[slotnum].timestamp))) {
|
if (grid.children[slotnum].className == "game" && !(Object.keys(json).includes(grid.children[slotnum].timestamp))) {
|
||||||
grid.removeChild(grid.children[slotnum]);
|
grid.removeChild(grid.children[slotnum]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var requiredcells = Math.max(4, (3 * Math.ceil(Object.keys(json).length/3))+1);
|
||||||
console.log(Object.keys(json).length)
|
|
||||||
console.log(requiredcells)
|
|
||||||
console.log(grid.children.length)
|
|
||||||
|
|
||||||
while (grid.children.length > requiredcells) {
|
while (grid.children.length > requiredcells) {
|
||||||
grid.removeChild(grid.children[requiredcells]);
|
grid.removeChild(grid.children[requiredcells]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user