diff options
author | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-10-01 14:15:05 +0200 |
---|---|---|
committer | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-10-01 14:15:05 +0200 |
commit | 237e4d43229847bb69aadcfa6e6aca517128913b (patch) | |
tree | f36f0a1a1eec574c975d5a33fb6975b13bb457ba /WebInterface/NodeJSServer/src/modules/ui/server-listing.js | |
parent | 4013f66c732841beaa55733af2b5b9a5efa25572 (diff) |
Documented the code better and made some minor fixes
Diffstat (limited to 'WebInterface/NodeJSServer/src/modules/ui/server-listing.js')
-rw-r--r-- | WebInterface/NodeJSServer/src/modules/ui/server-listing.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/WebInterface/NodeJSServer/src/modules/ui/server-listing.js b/WebInterface/NodeJSServer/src/modules/ui/server-listing.js index 2c501fd..0069ac6 100644 --- a/WebInterface/NodeJSServer/src/modules/ui/server-listing.js +++ b/WebInterface/NodeJSServer/src/modules/ui/server-listing.js @@ -1,12 +1,26 @@ +/** + * Class for handling the server list + */ export default class ServerListing { + /** + * Creates reference to container + * @param {string} serverListId ID of the server list div + */ constructor(serverListId) { this.serverListing = document.getElementById(serverListId); } + /** + * Removes all elements currently in the server listing + */ flushElements() { this.serverListing.innerHTML = ''; } + /** + * Populates servers from a given array of games + * @param {array} array Array of available games + */ addElements(array) { for (let server of array) { const name = server['name']; |