summaryrefslogtreecommitdiff
path: root/WebInterface/NodeJSServer/src/modules/ui/server-listing.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebInterface/NodeJSServer/src/modules/ui/server-listing.js')
-rw-r--r--WebInterface/NodeJSServer/src/modules/ui/server-listing.js14
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'];