summaryrefslogtreecommitdiff
path: root/scripts/gui/lobby.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-02-11 11:15:37 -0500
committerKyle Gunger <kgunger12@gmail.com>2021-02-11 11:15:37 -0500
commit9afa0420b0d34d8484a71ae278e4dbd1630a035a (patch)
tree6e7a90d247ae89cd65caca71b2cbbaaceeff58ac /scripts/gui/lobby.js
parentaa92baae14882ccf38f311f71c64cc0a6205553e (diff)
Input and settings fixes
Diffstat (limited to 'scripts/gui/lobby.js')
-rw-r--r--scripts/gui/lobby.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/gui/lobby.js b/scripts/gui/lobby.js
index 5939697..431e2e5 100644
--- a/scripts/gui/lobby.js
+++ b/scripts/gui/lobby.js
@@ -1,3 +1,4 @@
+'use strict';
// ###############
// # TopBar Code #
// ###############
@@ -5,9 +6,10 @@
// TopBar represents the bar at the top of the screen when client is in the lobby.
class TopBar{
- constructor (el)
+ constructor (el, desktopSettings)
{
this.root = el;
+ this.desktopSettings = desktopSettings;
this.newGame = el.getElementsByClassName("new-game")[0];
this.mobileSettings = el.getElementsByClassName("mobile-settings")[0];
@@ -28,11 +30,18 @@ class TopBar{
}
// Toggle showing the mobile settings
- toggleMobileSettings () {
- if (this.mobileSettings.style.display !== "none")
+ toggleMobileSettings (settings) {
+ if (this.mobileSettings.style.display !== "none"){
this.mobileSettings.style.display = "none";
- else
+ settings.putSettings(this.desktopSettings);
+ } else {
this.mobileSettings.style.display = "block";
+ settings.putSettings(this.mobileSettings);
+ }
+ }
+
+ mobileSettingsOpen() {
+ return this.mobileSettings.style.display !== "none"
}
}