diff options
Diffstat (limited to 'client/angular/videos/components/list/videos-list.component.ts')
-rw-r--r-- | client/angular/videos/components/list/videos-list.component.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts index 94b064e16..56230e331 100644 --- a/client/angular/videos/components/list/videos-list.component.ts +++ b/client/angular/videos/components/list/videos-list.component.ts | |||
@@ -12,12 +12,13 @@ import { VideoMiniatureComponent } from './video-miniature.component'; | |||
12 | import { Search, SearchField } from '../../../app/search'; | 12 | import { Search, SearchField } from '../../../app/search'; |
13 | import { VideoSortComponent } from './video-sort.component'; | 13 | import { VideoSortComponent } from './video-sort.component'; |
14 | import { SortField } from './sort'; | 14 | import { SortField } from './sort'; |
15 | import { LoaderComponent } from '../../loader.component'; | ||
15 | 16 | ||
16 | @Component({ | 17 | @Component({ |
17 | selector: 'my-videos-list', | 18 | selector: 'my-videos-list', |
18 | styleUrls: [ 'app/angular/videos/components/list/videos-list.component.css' ], | 19 | styleUrls: [ 'app/angular/videos/components/list/videos-list.component.css' ], |
19 | templateUrl: 'app/angular/videos/components/list/videos-list.component.html', | 20 | templateUrl: 'app/angular/videos/components/list/videos-list.component.html', |
20 | directives: [ ROUTER_DIRECTIVES, PAGINATION_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent ] | 21 | directives: [ ROUTER_DIRECTIVES, PAGINATION_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent, LoaderComponent ] |
21 | }) | 22 | }) |
22 | 23 | ||
23 | export class VideosListComponent implements OnInit { | 24 | export class VideosListComponent implements OnInit { |
@@ -29,6 +30,7 @@ export class VideosListComponent implements OnInit { | |||
29 | total: 0 | 30 | total: 0 |
30 | }; | 31 | }; |
31 | sort: SortField; | 32 | sort: SortField; |
33 | loading: boolean = false; | ||
32 | 34 | ||
33 | private search: Search; | 35 | private search: Search; |
34 | 36 | ||
@@ -55,6 +57,9 @@ export class VideosListComponent implements OnInit { | |||
55 | } | 57 | } |
56 | 58 | ||
57 | getVideos() { | 59 | getVideos() { |
60 | this.loading = true; | ||
61 | this.videos = []; | ||
62 | |||
58 | let observable = null; | 63 | let observable = null; |
59 | 64 | ||
60 | if (this.search.value !== null) { | 65 | if (this.search.value !== null) { |
@@ -67,6 +72,7 @@ export class VideosListComponent implements OnInit { | |||
67 | ({ videos, totalVideos }) => { | 72 | ({ videos, totalVideos }) => { |
68 | this.videos = videos; | 73 | this.videos = videos; |
69 | this.pagination.total = totalVideos; | 74 | this.pagination.total = totalVideos; |
75 | this.loading = false; | ||
70 | }, | 76 | }, |
71 | error => alert(error) | 77 | error => alert(error) |
72 | ); | 78 | ); |