From: Chocobozzz Date: Fri, 27 May 2016 15:52:41 +0000 (+0200) Subject: Put presentation logic in the components X-Git-Tag: v0.0.1-alpha~894 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=inline;h=9bfe96e19f552a75eed790f8f3b68de11c9b7fef;p=github%2FChocobozzz%2FPeerTube.git Put presentation logic in the components --- diff --git a/client/app/videos/video-add/video-add.component.ts b/client/app/videos/video-add/video-add.component.ts index b11475ae9..eb10aedeb 100644 --- a/client/app/videos/video-add/video-add.component.ts +++ b/client/app/videos/video-add/video-add.component.ts @@ -25,9 +25,9 @@ export class VideoAddComponent implements OnInit { private form: any; constructor( - private router: Router, + private authService: AuthService, private elementRef: ElementRef, - private authService: AuthService + private router: Router ) {} ngOnInit() { @@ -62,8 +62,8 @@ export class VideoAddComponent implements OnInit { } uploadFile() { - this.form.headers = this.authService.getRequestHeader().toJSON(); this.form.formData = jQuery(this.elementRef.nativeElement).find('form').serializeArray(); + this.form.headers = this.authService.getRequestHeader().toJSON(); this.form.submit(); } } diff --git a/client/app/videos/video-list/video-list.component.html b/client/app/videos/video-list/video-list.component.html index edbbaf3ae..80b1e7b1b 100644 --- a/client/app/videos/video-list/video-list.component.html +++ b/client/app/videos/video-list/video-list.component.html @@ -6,7 +6,7 @@
-
There is no video.
+
There is no video.
diff --git a/client/app/videos/video-list/video-list.component.ts b/client/app/videos/video-list/video-list.component.ts index 23b97df32..131578681 100644 --- a/client/app/videos/video-list/video-list.component.ts +++ b/client/app/videos/video-list/video-list.component.ts @@ -80,6 +80,10 @@ export class VideoListComponent implements OnInit { ); } + noVideo() { + return !this.loading && this.videos.length === 0; + } + onRemoved(video: Video) { this.videos.splice(this.videos.indexOf(video), 1); }