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
width: 100%
.music-album .thumbnail
+transition(background, 200ms)
&:hover
background: #f0f0f0
cursor: pointer
a
color: $main-color
.music-album
&.selected
background: #e0e0e0
.thumbnail
background: #e0e0e0
a
color: $main-color
a
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 {
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