aboutsummaryrefslogtreecommitdiff
path: root/src/app/js/settings.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-01-20 01:58:14 +0100
committer0neGal <mail@0negal.com>2024-01-20 01:58:14 +0100
commitc03ce1dc5b1e320a94ef6307aa4c32132c5bf33c (patch)
tree2bde427830974dbec8b4881801e05cd88138c961 /src/app/js/settings.js
parente2bae48724505c5b09b6bb28f053b8492bd66ba6 (diff)
downloadViper-c03ce1dc5b1e320a94ef6307aa4c32132c5bf33c.tar.gz
Viper-c03ce1dc5b1e320a94ef6307aa4c32132c5bf33c.zip
added src/app/js/popups.js
This makes opening and closing popups a little bit easier, on top of it, it also fixes a bug where you could open the settings popup on top of the browser popup or other popups, and it'd hide the background blur, but still show both popups.
Diffstat (limited to 'src/app/js/settings.js')
-rw-r--r--src/app/js/settings.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/app/js/settings.js b/src/app/js/settings.js
index 8aeb2ca..a333e8b 100644
--- a/src/app/js/settings.js
+++ b/src/app/js/settings.js
@@ -1,28 +1,21 @@
var Settings = {
toggle: (state) => {
+ Settings.load();
+ options.scrollTo(0, 0);
+
+ popups.set("#options", state);
let settings_btn = document.getElementById("settings");
if (state) {
- Settings.load();
- options.scrollTo(0, 0);
- overlay.classList.add("shown");
- options.classList.add("shown");
settings_btn.classList.add("shown");
-
return;
- } else if (! state) {
+ } else if (state === false) {
if (state != undefined) {
- overlay.classList.remove("shown");
- options.classList.remove("shown");
settings_btn.classList.remove("shown");
return;
}
}
- Settings.load();
- options.scrollTo(0, 0);
- overlay.classList.toggle("shown");
- options.classList.toggle("shown");
settings_btn.classList.toggle("shown");
},
apply: () => {