Commit 076e7f68 authored by Alan Szlosek's avatar Alan Szlosek

fix playlistButton toggle logic

parent 8fc6dda4
......@@ -679,6 +679,7 @@ var showTab = function(name, index) {
var scrollPositionY = 0;
var hashes = {
/*
"#/playlist": function() {
if (handles.playlist.classList.contains('hidden')) {
scrollPositionY = window.scrollY;
......@@ -693,6 +694,7 @@ var hashes = {
handles.playlistButton.classList.remove('active');
}
},
*/
'#/catalog': function() {
//showTab('catalog');
// Show all artists
......@@ -891,6 +893,21 @@ handles.playlistContainer.addEventListener('click', function(event) {
});
*/
handles.playlistButton.addEventListener('click', function(event) {
if (handles.playlist.classList.contains('hidden')) {
scrollPositionY = window.scrollY;
handles.catalog.classList.add('hidden')
handles.playlist.classList.remove('hidden')
window.scrollTo(0, 0);
handles.playlistButton.classList.add('active');
} else {
handles.catalog.classList.remove('hidden')
handles.playlist.classList.add('hidden')
window.scrollTo(0, scrollPositionY);
handles.playlistButton.classList.remove('active');
}
});
var formatTime = function(duration) {
duration = Math.floor(duration);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment