diff options
Diffstat (limited to 'client/app/videos/video-list')
-rw-r--r-- | client/app/videos/video-list/video-list.component.ts | 26 | ||||
-rw-r--r-- | client/app/videos/video-list/video-miniature.component.ts | 8 | ||||
-rw-r--r-- | client/app/videos/video-list/video-sort.component.ts | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/client/app/videos/video-list/video-list.component.ts b/client/app/videos/video-list/video-list.component.ts index a88fb379a..3f54c98ce 100644 --- a/client/app/videos/video-list/video-list.component.ts +++ b/client/app/videos/video-list/video-list.component.ts | |||
@@ -31,26 +31,26 @@ export class VideoListComponent implements OnInit { | |||
31 | total: 0 | 31 | total: 0 |
32 | }; | 32 | }; |
33 | sort: SortField; | 33 | sort: SortField; |
34 | loading: boolean = false; | 34 | loading = false; |
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 videoService: VideoService, |
41 | private _routeParams: RouteParams, | 41 | private routeParams: RouteParams, |
42 | private _router: Router | 42 | private router: Router |
43 | ) { | 43 | ) { |
44 | this.search = { | 44 | this.search = { |
45 | value: this._routeParams.get('search'), | 45 | value: this.routeParams.get('search'), |
46 | field: <SearchField>this._routeParams.get('field') | 46 | field: <SearchField>this.routeParams.get('field') |
47 | }; | 47 | }; |
48 | 48 | ||
49 | this.sort = <SortField>this._routeParams.get('sort') || '-createdDate'; | 49 | this.sort = <SortField>this.routeParams.get('sort') || '-createdDate'; |
50 | } | 50 | } |
51 | 51 | ||
52 | ngOnInit() { | 52 | ngOnInit() { |
53 | if (this._authService.isLoggedIn()) { | 53 | if (this.authService.isLoggedIn()) { |
54 | this.user = User.load(); | 54 | this.user = User.load(); |
55 | } | 55 | } |
56 | 56 | ||
@@ -64,9 +64,9 @@ export class VideoListComponent implements OnInit { | |||
64 | let observable = null; | 64 | let observable = null; |
65 | 65 | ||
66 | if (this.search.value !== null) { | 66 | if (this.search.value !== null) { |
67 | observable = this._videoService.searchVideos(this.search, this.pagination, this.sort); | 67 | observable = this.videoService.searchVideos(this.search, this.pagination, this.sort); |
68 | } else { | 68 | } else { |
69 | observable = this._videoService.getVideos(this.pagination, this.sort); | 69 | observable = this.videoService.getVideos(this.pagination, this.sort); |
70 | } | 70 | } |
71 | 71 | ||
72 | observable.subscribe( | 72 | observable.subscribe( |
@@ -79,7 +79,7 @@ export class VideoListComponent implements OnInit { | |||
79 | ); | 79 | ); |
80 | } | 80 | } |
81 | 81 | ||
82 | onRemoved(video: Video): void { | 82 | onRemoved(video: Video) { |
83 | this.videos.splice(this.videos.indexOf(video), 1); | 83 | this.videos.splice(this.videos.indexOf(video), 1); |
84 | } | 84 | } |
85 | 85 | ||
@@ -95,7 +95,7 @@ export class VideoListComponent implements OnInit { | |||
95 | params.field = this.search.field; | 95 | params.field = this.search.field; |
96 | } | 96 | } |
97 | 97 | ||
98 | this._router.navigate(['VideosList', params]); | 98 | this.router.navigate(['VideosList', params]); |
99 | this.getVideos(); | 99 | this.getVideos(); |
100 | } | 100 | } |
101 | } | 101 | } |
diff --git a/client/app/videos/video-list/video-miniature.component.ts b/client/app/videos/video-list/video-miniature.component.ts index 817636768..73416607a 100644 --- a/client/app/videos/video-list/video-miniature.component.ts +++ b/client/app/videos/video-list/video-miniature.component.ts | |||
@@ -19,9 +19,9 @@ export class VideoMiniatureComponent { | |||
19 | @Input() video: Video; | 19 | @Input() video: Video; |
20 | @Input() user: User; | 20 | @Input() user: User; |
21 | 21 | ||
22 | hovering: boolean = false; | 22 | hovering = false; |
23 | 23 | ||
24 | constructor(private _videoService: VideoService) {} | 24 | constructor(private videoService: VideoService) {} |
25 | 25 | ||
26 | onHover() { | 26 | onHover() { |
27 | this.hovering = true; | 27 | this.hovering = true; |
@@ -31,13 +31,13 @@ export class VideoMiniatureComponent { | |||
31 | this.hovering = false; | 31 | this.hovering = false; |
32 | } | 32 | } |
33 | 33 | ||
34 | displayRemoveIcon(): boolean { | 34 | displayRemoveIcon() { |
35 | return this.hovering && this.video.isRemovableBy(this.user); | 35 | return this.hovering && this.video.isRemovableBy(this.user); |
36 | } | 36 | } |
37 | 37 | ||
38 | removeVideo(id: string) { | 38 | removeVideo(id: string) { |
39 | if (confirm('Do you really want to remove this video?')) { | 39 | if (confirm('Do you really want to remove this video?')) { |
40 | this._videoService.removeVideo(id).subscribe( | 40 | this.videoService.removeVideo(id).subscribe( |
41 | status => this.removed.emit(true), | 41 | status => this.removed.emit(true), |
42 | error => alert(error) | 42 | error => alert(error) |
43 | ); | 43 | ); |
diff --git a/client/app/videos/video-list/video-sort.component.ts b/client/app/videos/video-list/video-sort.component.ts index d00d7ed49..ed06c7510 100644 --- a/client/app/videos/video-list/video-sort.component.ts +++ b/client/app/videos/video-list/video-sort.component.ts | |||
@@ -26,7 +26,7 @@ export class VideoSortComponent { | |||
26 | return Object.keys(this.sortChoices); | 26 | return Object.keys(this.sortChoices); |
27 | } | 27 | } |
28 | 28 | ||
29 | getStringChoice(choiceKey: SortField): string { | 29 | getStringChoice(choiceKey: SortField) { |
30 | return this.sortChoices[choiceKey]; | 30 | return this.sortChoices[choiceKey]; |
31 | } | 31 | } |
32 | 32 | ||