diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-05-27 17:49:18 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-05-27 17:49:18 +0200 |
commit | 4fd8aa327004b27530fd96bdde5df60e6745a1f6 (patch) | |
tree | e3b21282c641d50ea62e227c6ce3e7e740fec860 /client/app/videos/video-list | |
parent | ccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd (diff) | |
download | PeerTube-4fd8aa327004b27530fd96bdde5df60e6745a1f6.tar.gz PeerTube-4fd8aa327004b27530fd96bdde5df60e6745a1f6.tar.zst PeerTube-4fd8aa327004b27530fd96bdde5df60e6745a1f6.zip |
Alphabetical
Diffstat (limited to 'client/app/videos/video-list')
-rw-r--r-- | client/app/videos/video-list/video-list.component.ts | 13 | ||||
-rw-r--r-- | client/app/videos/video-list/video-miniature.component.ts | 10 |
2 files changed, 12 insertions, 11 deletions
diff --git a/client/app/videos/video-list/video-list.component.ts b/client/app/videos/video-list/video-list.component.ts index 3f54c98ce..23b97df32 100644 --- a/client/app/videos/video-list/video-list.component.ts +++ b/client/app/videos/video-list/video-list.component.ts | |||
@@ -23,23 +23,23 @@ import { VideoSortComponent } from './video-sort.component'; | |||
23 | }) | 23 | }) |
24 | 24 | ||
25 | export class VideoListComponent implements OnInit { | 25 | export class VideoListComponent implements OnInit { |
26 | user: User = null; | 26 | loading = false; |
27 | videos: Video[] = []; | ||
28 | pagination: Pagination = { | 27 | pagination: Pagination = { |
29 | currentPage: 1, | 28 | currentPage: 1, |
30 | itemsPerPage: 9, | 29 | itemsPerPage: 9, |
31 | total: 0 | 30 | total: 0 |
32 | }; | 31 | }; |
33 | sort: SortField; | 32 | sort: SortField; |
34 | loading = false; | 33 | user: User = null; |
34 | videos: Video[] = []; | ||
35 | 35 | ||
36 | private search: Search; | 36 | private search: Search; |
37 | 37 | ||
38 | constructor( | 38 | constructor( |
39 | private authService: AuthService, | 39 | private authService: AuthService, |
40 | private videoService: VideoService, | 40 | private router: Router, |
41 | private routeParams: RouteParams, | 41 | private routeParams: RouteParams, |
42 | private router: Router | 42 | private videoService: VideoService |
43 | ) { | 43 | ) { |
44 | this.search = { | 44 | this.search = { |
45 | value: this.routeParams.get('search'), | 45 | value: this.routeParams.get('search'), |
@@ -73,6 +73,7 @@ export class VideoListComponent implements OnInit { | |||
73 | ({ videos, totalVideos }) => { | 73 | ({ videos, totalVideos }) => { |
74 | this.videos = videos; | 74 | this.videos = videos; |
75 | this.pagination.total = totalVideos; | 75 | this.pagination.total = totalVideos; |
76 | |||
76 | this.loading = false; | 77 | this.loading = false; |
77 | }, | 78 | }, |
78 | error => alert(error) | 79 | error => alert(error) |
@@ -91,8 +92,8 @@ export class VideoListComponent implements OnInit { | |||
91 | }; | 92 | }; |
92 | 93 | ||
93 | if (this.search.value) { | 94 | if (this.search.value) { |
94 | params.search = this.search.value; | ||
95 | params.field = this.search.field; | 95 | params.field = this.search.field; |
96 | params.search = this.search.value; | ||
96 | } | 97 | } |
97 | 98 | ||
98 | this.router.navigate(['VideosList', params]); | 99 | this.router.navigate(['VideosList', params]); |
diff --git a/client/app/videos/video-list/video-miniature.component.ts b/client/app/videos/video-list/video-miniature.component.ts index 73416607a..3baa1ddd6 100644 --- a/client/app/videos/video-list/video-miniature.component.ts +++ b/client/app/videos/video-list/video-miniature.component.ts | |||
@@ -16,23 +16,23 @@ import { User } from '../../users/index'; | |||
16 | export class VideoMiniatureComponent { | 16 | export class VideoMiniatureComponent { |
17 | @Output() removed = new EventEmitter<any>(); | 17 | @Output() removed = new EventEmitter<any>(); |
18 | 18 | ||
19 | @Input() video: Video; | ||
20 | @Input() user: User; | 19 | @Input() user: User; |
20 | @Input() video: Video; | ||
21 | 21 | ||
22 | hovering = false; | 22 | hovering = false; |
23 | 23 | ||
24 | constructor(private videoService: VideoService) {} | 24 | constructor(private videoService: VideoService) {} |
25 | 25 | ||
26 | onHover() { | 26 | displayRemoveIcon() { |
27 | this.hovering = true; | 27 | return this.hovering && this.video.isRemovableBy(this.user); |
28 | } | 28 | } |
29 | 29 | ||
30 | onBlur() { | 30 | onBlur() { |
31 | this.hovering = false; | 31 | this.hovering = false; |
32 | } | 32 | } |
33 | 33 | ||
34 | displayRemoveIcon() { | 34 | onHover() { |
35 | return this.hovering && this.video.isRemovableBy(this.user); | 35 | this.hovering = true; |
36 | } | 36 | } |
37 | 37 | ||
38 | removeVideo(id: string) { | 38 | removeVideo(id: string) { |