From 45375e2f4a56d63999922b4e6e646504e710f045 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Tue, 5 May 2020 13:07:34 +0200 Subject: [PATCH] Added slim download tab toggle in settings --- public/index.html | 4 ++++ public/js/app.js | 3 +++ public/js/modules/components/settings-tab.js | 13 ++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 73f16f4..c43d04b 100644 --- a/public/index.html +++ b/public/index.html @@ -518,6 +518,10 @@

Settings

Dark Mode +
diff --git a/public/js/app.js b/public/js/app.js index ad52e7c..1923121 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -96,6 +96,9 @@ function startApp() { socket.emit('login', arl) $('#login_input_arl').val(arl) } + if ('true' === localStorage.getItem('slimDownloads')) { + document.getElementById("download_list").classList.add("slim") + } // Open default tab document.getElementById('main_home_tablink').click() diff --git a/public/js/modules/components/settings-tab.js b/public/js/modules/components/settings-tab.js index 2d42860..685a55b 100644 --- a/public/js/modules/components/settings-tab.js +++ b/public/js/modules/components/settings-tab.js @@ -16,9 +16,20 @@ const SettingsTab = new Vue({ }, set(wantDarkMode) { document.documentElement.setAttribute('data-theme', wantDarkMode ? 'dark' : 'default') - localStorage.setItem('darkMode', wantDarkMode) } + }, + slimDownloads: { + get() { + return 'true' === localStorage.getItem('slimDownloads') + }, + set(wantSlimDownloads) { + if (wantSlimDownloads) + document.getElementById("download_list").classList.add("slim") + else + document.getElementById("download_list").classList.remove("slim") + localStorage.setItem('slimDownloads', wantSlimDownloads) + } } }, methods: {