mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Pass page to directive
This commit is contained in:
parent
7fc9310760
commit
6248f07eb1
3 changed files with 65 additions and 63 deletions
|
@ -1,4 +1,4 @@
|
|||
<div class="classifier">
|
||||
<pfm-paged-tracks-list type="all" click-override="clickOverride(id)" has-override="true" 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" admin="true"></pfm-paged-tracks-list>
|
||||
<pfm-track-editor track-id="trackIdToEdit" class="classifier-track-editor"></pfm-track-editor>
|
||||
</div>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<pfm-paged-tracks-list type="all"></pfm-paged-tracks-list>
|
||||
<pfm-paged-tracks-list type="all" admin="true"></pfm-paged-tracks-list>
|
||||
|
|
|
@ -23,14 +23,17 @@ module.exports = angular.module('ponyfm').directive 'pfmPagedTracksList', () ->
|
|||
class: '@class'
|
||||
clickOverride: '&'
|
||||
hasOverride: '@'
|
||||
admin: '@'
|
||||
|
||||
controller: [
|
||||
'$scope', 'tracks', '$state', '$location'
|
||||
($scope, tracks, $state, $location) ->
|
||||
tracks.loadFilters().then(->
|
||||
|
||||
$scope.filters = tracks.filters
|
||||
$scope.query = tracks.mainQuery
|
||||
tracks.mainQuery.fromFilterString($state.params.filter)
|
||||
tracks.mainQuery.setPage $state.params.page || 1
|
||||
tracks.mainQuery.setAdmin $scope.admin || false
|
||||
|
||||
$scope.toggleListFilter = (filter, id) ->
|
||||
$scope.query.toggleListFilter filter, id
|
||||
|
@ -103,5 +106,4 @@ module.exports = angular.module('ponyfm').directive 'pfmPagedTracksList', () ->
|
|||
|
||||
$scope.jumpToPage = (inputPageNumber) ->
|
||||
$scope.gotoPage(inputPageNumber)
|
||||
)
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue