X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-account%2Fmy-account-videos%2Fmy-account-videos.component.ts;h=2d88ac760bc6254fb9e3a08d3432a4f23f7896d4;hb=c199c427d4ae586339822320f20f512a7a19dc3f;hp=01e1ef1da28780877338322926d55f217c77d406;hpb=3d52b300ea79bec21f090e2447c4808307078618;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts index 01e1ef1da..2d88ac760 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts @@ -1,6 +1,6 @@ import { from as observableFrom, Observable } from 'rxjs' import { concatAll, tap } from 'rxjs/operators' -import { Component, OnDestroy, OnInit, Inject, LOCALE_ID } from '@angular/core' +import { Component, OnDestroy, OnInit, Inject, LOCALE_ID, ViewChild } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { Location } from '@angular/common' import { immutableAssign } from '@app/shared/misc/utils' @@ -14,6 +14,7 @@ import { VideoService } from '../../shared/video/video.service' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoPrivacy, VideoState } from '../../../../../shared/models/videos' import { ScreenService } from '@app/shared/misc/screen.service' +import { VideoChangeOwnershipComponent } from './video-change-ownership/video-change-ownership.component' @Component({ selector: 'my-account-videos', @@ -33,6 +34,8 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni protected baseVideoWidth = -1 protected baseVideoHeight = 155 + @ViewChild('videoChangeOwnershipModal') videoChangeOwnershipModal: VideoChangeOwnershipComponent + constructor ( protected router: Router, protected route: ActivatedRoute, @@ -133,6 +136,11 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni ) } + changeOwnership (event: Event, video: Video) { + event.preventDefault() + this.videoChangeOwnershipModal.show(video) + } + getStateLabel (video: Video) { let suffix: string @@ -161,7 +169,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni private spliceVideosById (id: number) { for (const key of Object.keys(this.loadedPages)) { - const videos = this.loadedPages[ key ] + const videos: Video[] = this.loadedPages[ key ] const index = videos.findIndex(v => v.id === id) if (index !== -1) {