]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/app/videos/video-list/video-list.component.ts
Move scripty and node sass into the main dependencies
[github/Chocobozzz/PeerTube.git] / client / app / videos / video-list / video-list.component.ts
index 3f54c98ceda6ca94e54785865d7360608e2836c9..6322860be8b0e8f3cd8d9a8f4df1a649af4fd9f3 100644 (file)
@@ -19,27 +19,27 @@ import { VideoSortComponent } from './video-sort.component';
   selector: 'my-videos-list',
   styleUrls: [ 'client/app/videos/video-list/video-list.component.css' ],
   templateUrl: 'client/app/videos/video-list/video-list.component.html',
-  directives: [ ROUTER_DIRECTIVES, PAGINATION_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent, LoaderComponent ]
+  directives: [ LoaderComponent, PAGINATION_DIRECTIVES, ROUTER_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent ]
 })
 
 export class VideoListComponent implements OnInit {
-  user: User = null;
-  videos: Video[] = [];
+  loading = false;
   pagination: Pagination = {
     currentPage: 1,
     itemsPerPage: 9,
     total: 0
   };
   sort: SortField;
-  loading = false;
+  user: User = null;
+  videos: Video[] = [];
 
   private search: Search;
 
   constructor(
     private authService: AuthService,
-    private videoService: VideoService,
+    private router: Router,
     private routeParams: RouteParams,
-    private router: Router
+    private videoService: VideoService
   ) {
     this.search = {
       value: this.routeParams.get('search'),
@@ -73,12 +73,17 @@ export class VideoListComponent implements OnInit {
       ({ videos, totalVideos }) => {
         this.videos = videos;
         this.pagination.total = totalVideos;
+
         this.loading = false;
       },
       error => alert(error)
     );
   }
 
+  noVideo() {
+    return !this.loading && this.videos.length === 0;
+  }
+
   onRemoved(video: Video) {
     this.videos.splice(this.videos.indexOf(video), 1);
   }
@@ -91,8 +96,8 @@ export class VideoListComponent implements OnInit {
     };
 
     if (this.search.value) {
-      params.search = this.search.value;
       params.field = this.search.field;
+      params.search = this.search.value;
     }
 
     this.router.navigate(['VideosList', params]);