diff options
Diffstat (limited to 'client/src/app/videos')
7 files changed, 20 insertions, 88 deletions
diff --git a/client/src/app/videos/video-list/index.ts b/client/src/app/videos/video-list/index.ts index a5a60364a..594e31984 100644 --- a/client/src/app/videos/video-list/index.ts +++ b/client/src/app/videos/video-list/index.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | export * from './my-videos.component' | ||
2 | export * from './video-recently-added.component' | 1 | export * from './video-recently-added.component' |
3 | export * from './video-trending.component' | 2 | export * from './video-trending.component' |
4 | export * from './shared' | 3 | export * from './shared' |
diff --git a/client/src/app/videos/video-list/my-videos.component.ts b/client/src/app/videos/video-list/my-videos.component.ts deleted file mode 100644 index 146db8262..000000000 --- a/client/src/app/videos/video-list/my-videos.component.ts +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | ||
2 | import { ActivatedRoute, Router } from '@angular/router' | ||
3 | |||
4 | import { NotificationsService } from 'angular2-notifications' | ||
5 | |||
6 | import { AbstractVideoList } from './shared' | ||
7 | import { VideoService } from '../shared' | ||
8 | |||
9 | @Component({ | ||
10 | selector: 'my-videos', | ||
11 | styleUrls: [ './shared/abstract-video-list.scss' ], | ||
12 | templateUrl: './shared/abstract-video-list.html' | ||
13 | }) | ||
14 | export class MyVideosComponent extends AbstractVideoList implements OnInit, OnDestroy { | ||
15 | |||
16 | constructor ( | ||
17 | protected router: Router, | ||
18 | protected route: ActivatedRoute, | ||
19 | protected notificationsService: NotificationsService, | ||
20 | private videoService: VideoService | ||
21 | ) { | ||
22 | super() | ||
23 | } | ||
24 | |||
25 | ngOnInit () { | ||
26 | super.ngOnInit() | ||
27 | } | ||
28 | |||
29 | ngOnDestroy () { | ||
30 | super.ngOnDestroy() | ||
31 | } | ||
32 | |||
33 | getVideosObservable () { | ||
34 | return this.videoService.getMyVideos(this.pagination, this.sort) | ||
35 | } | ||
36 | } | ||
diff --git a/client/src/app/videos/video-list/shared/abstract-video-list.html b/client/src/app/videos/video-list/shared/abstract-video-list.html index 69e16319e..bd4f6b1f8 100644 --- a/client/src/app/videos/video-list/shared/abstract-video-list.html +++ b/client/src/app/videos/video-list/shared/abstract-video-list.html | |||
@@ -1,18 +1,19 @@ | |||
1 | <div class="title-page"> | 1 | <div class="margin-content"> |
2 | {{ titlePage }} | 2 | <div class="title-page title-page-single"> |
3 | </div> | 3 | {{ titlePage }} |
4 | </div> | ||
4 | 5 | ||
5 | <div | 6 | <div |
6 | class="videos-miniatures" | 7 | infiniteScroll |
7 | infiniteScroll | 8 | [infiniteScrollUpDistance]="1.5" |
8 | [infiniteScrollUpDistance]="1.5" | 9 | [infiniteScrollDistance]="0.5" |
9 | [infiniteScrollDistance]="0.5" | 10 | (scrolled)="onNearOfBottom()" |
10 | (scrolled)="onNearOfBottom()" | 11 | (scrolledUp)="onNearOfTop()" |
11 | (scrolledUp)="onNearOfTop()" | ||
12 | > | ||
13 | <my-video-miniature | ||
14 | class="ng-animate" | ||
15 | *ngFor="let video of videos" [video]="video" [user]="user" [currentSort]="sort" | ||
16 | > | 12 | > |
17 | </my-video-miniature> | 13 | <my-video-miniature |
14 | class="ng-animate" | ||
15 | *ngFor="let video of videos" [video]="video" [user]="user" [currentSort]="sort" | ||
16 | > | ||
17 | </my-video-miniature> | ||
18 | </div> | ||
18 | </div> | 19 | </div> |
diff --git a/client/src/app/videos/video-list/shared/abstract-video-list.scss b/client/src/app/videos/video-list/shared/abstract-video-list.scss index de174802b..e69de29bb 100644 --- a/client/src/app/videos/video-list/shared/abstract-video-list.scss +++ b/client/src/app/videos/video-list/shared/abstract-video-list.scss | |||
@@ -1,23 +0,0 @@ | |||
1 | .videos-info { | ||
2 | @media screen and (max-width: 400px) { | ||
3 | margin-left: 0; | ||
4 | } | ||
5 | |||
6 | border-bottom: 1px solid #f1f1f1; | ||
7 | height: 40px; | ||
8 | line-height: 40px; | ||
9 | |||
10 | .videos-total-results { | ||
11 | font-size: 13px; | ||
12 | } | ||
13 | |||
14 | my-loader { | ||
15 | display: inline-block; | ||
16 | margin-left: 5px; | ||
17 | } | ||
18 | } | ||
19 | |||
20 | pagination { | ||
21 | display: block; | ||
22 | text-align: center; | ||
23 | } | ||
diff --git a/client/src/app/videos/video-list/shared/abstract-video-list.ts b/client/src/app/videos/video-list/shared/abstract-video-list.ts index 44cdc1d9f..a684ffef4 100644 --- a/client/src/app/videos/video-list/shared/abstract-video-list.ts +++ b/client/src/app/videos/video-list/shared/abstract-video-list.ts | |||
@@ -36,7 +36,9 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
36 | } | 36 | } |
37 | 37 | ||
38 | ngOnDestroy () { | 38 | ngOnDestroy () { |
39 | this.subActivatedRoute.unsubscribe() | 39 | if (this.subActivatedRoute) { |
40 | this.subActivatedRoute.unsubscribe() | ||
41 | } | ||
40 | } | 42 | } |
41 | 43 | ||
42 | onNearOfTop () { | 44 | onNearOfTop () { |
diff --git a/client/src/app/videos/videos-routing.module.ts b/client/src/app/videos/videos-routing.module.ts index 1f894df7a..204851c81 100644 --- a/client/src/app/videos/videos-routing.module.ts +++ b/client/src/app/videos/videos-routing.module.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | import { MetaGuard } from '@ngx-meta/core' | 3 | import { MetaGuard } from '@ngx-meta/core' |
4 | import { MyVideosComponent } from './video-list' | ||
5 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' | 4 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' |
6 | import { VideoTrendingComponent } from './video-list/video-trending.component' | 5 | import { VideoTrendingComponent } from './video-list/video-trending.component' |
7 | import { VideosComponent } from './videos.component' | 6 | import { VideosComponent } from './videos.component' |
@@ -18,15 +17,6 @@ const videosRoutes: Routes = [ | |||
18 | redirectTo: 'recently-added' | 17 | redirectTo: 'recently-added' |
19 | }, | 18 | }, |
20 | { | 19 | { |
21 | path: 'mine', | ||
22 | component: MyVideosComponent, | ||
23 | data: { | ||
24 | meta: { | ||
25 | title: 'My videos' | ||
26 | } | ||
27 | } | ||
28 | }, | ||
29 | { | ||
30 | path: 'trending', | 20 | path: 'trending', |
31 | component: VideoTrendingComponent, | 21 | component: VideoTrendingComponent, |
32 | data: { | 22 | data: { |
diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/videos/videos.module.ts index f3981d275..1d6194158 100644 --- a/client/src/app/videos/videos.module.ts +++ b/client/src/app/videos/videos.module.ts | |||
@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core' | |||
2 | import { InfiniteScrollModule } from 'ngx-infinite-scroll' | 2 | import { InfiniteScrollModule } from 'ngx-infinite-scroll' |
3 | import { SharedModule } from '../shared' | 3 | import { SharedModule } from '../shared' |
4 | import { VideoService } from './shared' | 4 | import { VideoService } from './shared' |
5 | import { MyVideosComponent, VideoMiniatureComponent } from './video-list' | 5 | import { VideoMiniatureComponent } from './video-list' |
6 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' | 6 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' |
7 | import { VideoTrendingComponent } from './video-list/video-trending.component' | 7 | import { VideoTrendingComponent } from './video-list/video-trending.component' |
8 | import { VideosRoutingModule } from './videos-routing.module' | 8 | import { VideosRoutingModule } from './videos-routing.module' |
@@ -20,7 +20,6 @@ import { VideosComponent } from './videos.component' | |||
20 | 20 | ||
21 | VideoTrendingComponent, | 21 | VideoTrendingComponent, |
22 | VideoRecentlyAddedComponent, | 22 | VideoRecentlyAddedComponent, |
23 | MyVideosComponent, | ||
24 | VideoMiniatureComponent | 23 | VideoMiniatureComponent |
25 | ], | 24 | ], |
26 | 25 | ||