Fixed some of the album selection stuff

This commit is contained in:
gballan1 2016-11-28 20:16:54 -05:00
parent a6663db3e6
commit d1a5a5385f
3 changed files with 22 additions and 20 deletions

View File

@ -62,18 +62,20 @@
.album-art .album-art
width: 100% width: 100%
.music-album .thumbnail .music-album
+transition(background, 200ms)
&:hover
background: #f0f0f0
cursor: pointer
a
color: $main-color
&.selected &.selected
background: #e0e0e0 .thumbnail
background: #e0e0e0
a a
color: $main-color color: $main-color
.thumbnail
+transition(background, 200ms)
&:hover
background: #f0f0f0
cursor: pointer
a
color: $main-color

View File

@ -680,6 +680,10 @@ body {
.album-art { .album-art {
width: 100%; } width: 100%; }
.music-album.selected .thumbnail {
background: #e0e0e0; }
.music-album.selected .thumbnail a {
color: #e51400; }
.music-album .thumbnail { .music-album .thumbnail {
-webkit-transition: background, 200ms; -webkit-transition: background, 200ms;
-moz-transition: background, 200ms; -moz-transition: background, 200ms;
@ -689,10 +693,6 @@ body {
cursor: pointer; } cursor: pointer; }
.music-album .thumbnail:hover a { .music-album .thumbnail:hover a {
color: #e51400; } color: #e51400; }
.music-album .thumbnail.selected {
background: #e0e0e0; }
.music-album .thumbnail.selected a {
color: #e51400; }
.shows-header { .shows-header {
margin-top: -20px; margin-top: -20px;

View File

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