Added slim download tab toggle in settings

This commit is contained in:
RemixDev 2020-05-05 13:07:34 +02:00
parent e703ee66a7
commit 45375e2f4a
3 changed files with 19 additions and 1 deletions

View File

@ -518,6 +518,10 @@ <h2 id="settings_heading">Settings</h2>
<input type="checkbox" v-model="darkMode">
<span class="checkbox_text">Dark Mode</span>
</label>
<label class="with_checkbox">
<input type="checkbox" v-model="slimDownloads">
<span class="checkbox_text">Slim download tab</span>
</label>
</div>
<div class="settings_group">

View File

@ -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()

View File

@ -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: {