added shuffle status to localstorage

This commit is contained in:
2022-07-16 14:13:44 -05:00
parent c57ddeaef7
commit df116510e4

View File

@@ -210,13 +210,18 @@
function toggleShuffle () {
g_shuffle = !g_shuffle;
toggleShuffleColor();
localStorage['shuffle'] = g_shuffle;
}
function toggleShuffleColor() {
if (g_shuffle) {
$('#btn-shuffle').css('color', '#FF9148');
}
else {
$('#btn-shuffle').css('color', '#808080');
}
}
function populatePlaylistOptions () {
@@ -355,6 +360,20 @@
playlist = localStorage.getItem ('playlist');
}
if (localStorage.getItem ('shuffle') !== null) {
let shuffle = localStorage.getItem('shuffle');
if (shuffle === 'false') {
g_shuffle = false;
}
else {
g_shuffle = true;
}
toggleShuffleColor();
}
// If hash is set, override playlist and track
var url_track = parseTrackId (window.location.hash.substr (1));