Fixed some of the album selection stuff

This commit is contained in:
gballan1 2016-11-28 20:26:19 -05:00
parent d1a5a5385f
commit bb7d66250b

View File

@ -10,12 +10,25 @@ $(document).ready(function() {
}); });
// on album art click // on album art click
$('.music-album thumbnail').on('click', function() { $('.music-album .thumbnail').on('click', function() {
// change selected album // change selected album
changeSelectedAlbum(this); changeSelectedAlbum(this);
}); });
}); });
function changeSelectedAlbum(albumElem) {
var oldSelected = $('.music-album.selected');
var newSelected = $(albumElem).parent();
if (oldSelected.data('albumid') != newSelected.data('albumid')) {
// remove selected class from the old element and add it to the new one
oldSelected.removeClass('selected');
newSelected.addClass('selected');
// change available songs
}
}
function changeSelectedAlbum(albumElem) { function changeSelectedAlbum(albumElem) {
var oldSelected = $('.music-album.selected').parent(); var oldSelected = $('.music-album.selected').parent();
var newSelected = $(albumElem).parent(); var newSelected = $(albumElem).parent();