Added slim download tab toggle in settings
This commit is contained in:
parent
e703ee66a7
commit
45375e2f4a
@ -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">
|
||||
|
@ -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()
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user