Skip to content

Commit

Permalink
quick fix for when disliking liked track from the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
weblancaster committed Oct 26, 2015
1 parent d4e9060 commit 5215fe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/public/js/common/favoriteSongDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ app.directive('favoriteSong', function($rootScope, $log, SCapiService, $timeout,
userId = $rootScope.userId;
songId = attrs.songId;

if ( $scope.favorite ) {
if ( this.classList.contains('liked') ) {

SCapiService.deleteFavorite(userId, songId)
.then(function(status) {
Expand Down
3 changes: 2 additions & 1 deletion app/public/js/common/utilsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ app.factory('utilsService', function(
/**
* Find track and mark as favorited
* @param trackId (track id)
* @method markTrackAsFav
* @method markTrackAsFavorite
*/
utils.markTrackAsFavorite = function(trackId) {
var track = document.querySelector('a[data-song-id="' + trackId + '"]');
track.classList.add('liked');
//track.setAttribute('favorite', true);
};

/**
Expand Down

0 comments on commit 5215fe1

Please sign in to comment.