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,7 +62,15 @@
.album-art
width: 100%
.music-album .thumbnail
.music-album
&.selected
.thumbnail
background: #e0e0e0
a
color: $main-color
.thumbnail
+transition(background, 200ms)
&:hover
@ -71,9 +79,3 @@
a
color: $main-color
&.selected
background: #e0e0e0
a
color: $main-color

View File

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

View File

@ -10,15 +10,15 @@ $(document).ready(function() {
});
// on album art click
$('.music-album').on('click', function() {
$('.music-album thumbnail').on('click', function() {
// change selected album
changeSelectedAlbum(this);
});
});
function changeSelectedAlbum(albumElem) {
var oldSelected = $('.music-album.selected');
var newSelected = $(albumElem);
var oldSelected = $('.music-album.selected').parent();
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