From bf64ed4196938ba9002c887cadb01bd2a6e3127a Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sat, 28 Dec 2019 01:10:26 +0100 Subject: Add search bars for a user's videos and playlist library --- .../my-account-videos.component.html | 4 ++++ .../my-account-videos.component.scss | 11 ++++++++++ .../my-account-videos.component.ts | 25 +++++++++++++++++----- 3 files changed, 35 insertions(+), 5 deletions(-) (limited to 'client/src/app/+my-account/my-account-videos') diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.html b/client/src/app/+my-account/my-account-videos/my-account-videos.component.html index 2854093c4..a898cd938 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.html +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.html @@ -1,3 +1,7 @@ +
+ +
+ () getVideosObservableFunction = this.getVideosObservable.bind(this) constructor ( @@ -59,6 +61,19 @@ export class MyAccountVideosComponent implements DisableForReuseHook { this.titlePage = this.i18n('My videos') } + ngOnInit () { + this.videosSearchChanged + .pipe( + debounceTime(500)) + .subscribe(() => { + this.videosSelection.reloadVideos() + }) + } + + onVideosSearchChanged () { + this.videosSearchChanged.next() + } + disableForReuse () { this.videosSelection.disableForReuse() } @@ -70,7 +85,7 @@ export class MyAccountVideosComponent implements DisableForReuseHook { getVideosObservable (page: number, sort: VideoSortField) { const newPagination = immutableAssign(this.pagination, { currentPage: page }) - return this.videoService.getMyVideos(newPagination, sort) + return this.videoService.getMyVideos(newPagination, sort, this.videosSearch) } async deleteSelectedVideos () { -- cgit v1.2.3