Fixed override detection

This commit is contained in:
Josef Citrine 2016-08-29 23:32:58 +01:00
parent 2c87852c66
commit cf7bd8b9e6
5 changed files with 7 additions and 4 deletions

View file

@ -1,4 +1,4 @@
<div class="classifier"> <div class="classifier">
<pfm-paged-tracks-list type="all" click-override="clickOverride(id)" class="classifier-track-list"></pfm-paged-tracks-list> <pfm-paged-tracks-list type="all" click-override="clickOverride(id)" has-override="true" class="classifier-track-list"></pfm-paged-tracks-list>
<pfm-track-editor track-id="trackIdToEdit" class="classifier-track-editor"></pfm-track-editor> <pfm-track-editor track-id="trackIdToEdit" class="classifier-track-editor"></pfm-track-editor>
</div> </div>

View file

@ -17,6 +17,7 @@
</div> </div>
<div class="stretch-to-bottom"> <div class="stretch-to-bottom">
<pfm-tracks-list tracks="tracks" class="three-columns" click-override="newClickOverride(id)"></pfm-tracks-list> <pfm-tracks-list ng-if="hasOverride" tracks="tracks" class="three-columns" click-override="newClickOverride(id)" has-override="true"></pfm-tracks-list>
<pfm-tracks-list ng-if="!hasOverride" tracks="tracks" class="three-columns"></pfm-tracks-list>
</div> </div>
</div> </div>

View file

@ -16,7 +16,7 @@
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
</a> </a>
</div> </div>
<a class="info" ng-href="{{::track.url}}" ng-if="!clickOverride"> <a class="info" ng-href="{{::track.url}}" ng-if="!hasOverride">
<span class="title">{{::track.title}}</span> <span class="title">{{::track.title}}</span>
<span class="stats" title="{{::track.stats.favourites}} Favourites / {{:: track.stats.comments}} Comments / {{::track.stats.plays}} Plays"> <span class="stats" title="{{::track.stats.favourites}} Favourites / {{:: track.stats.comments}} Comments / {{::track.stats.plays}} Plays">
<strong>{{::track.stats.favourites}}</strong>f <strong>{{::track.stats.favourites}}</strong>f
@ -25,7 +25,7 @@
</span> </span>
<span class="artist">{{::track.user.name}} / {{::track.genre.name}}</span> <span class="artist">{{::track.user.name}} / {{::track.genre.name}}</span>
</a> </a>
<a class="info" ng-if="clickOverride" href="#" ng-click="clickOverride({id: track.id})"> <a class="info" ng-if="hasOverride" href="#" ng-click="clickOverride({id: track.id})">
<span class="title">{{::track.title}}</span> <span class="title">{{::track.title}}</span>
<span class="stats" title="{{::track.stats.favourites}} Favourites / {{:: track.stats.comments}} Comments / {{::track.stats.plays}} Plays"> <span class="stats" title="{{::track.stats.favourites}} Favourites / {{:: track.stats.comments}} Comments / {{::track.stats.plays}} Plays">
<strong>{{::track.stats.favourites}}</strong>f <strong>{{::track.stats.favourites}}</strong>f

View file

@ -22,6 +22,7 @@ module.exports = angular.module('ponyfm').directive 'pfmPagedTracksList', () ->
type: '@' type: '@'
class: '@class' class: '@class'
clickOverride: '&' clickOverride: '&'
hasOverride: '@'
controller: [ controller: [
'$scope', 'tracks', '$state', '$location' '$scope', 'tracks', '$state', '$location'

View file

@ -23,6 +23,7 @@ module.exports = angular.module('ponyfm').directive 'pfmTracksList', () ->
tracks: '=tracks' tracks: '=tracks'
class: '@class' class: '@class'
clickOverride: '&' clickOverride: '&'
hasOverride: '@'
controller: [ controller: [
'$modal', '$scope', 'favourites', 'player', 'playlists', 'auth' '$modal', '$scope', 'favourites', 'player', 'playlists', 'auth'