diff --git a/index.html b/index.html index 216872c..f712613 100644 --- a/index.html +++ b/index.html @@ -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));