]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/modal/video-download.component.ts
remove unused imports
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / modal / video-download.component.ts
index 2de706e47a707bd0b253f22aa4ca28b60e088fac..f4d9003ee74db62ec99d6008624b473aacfcabaa 100644 (file)
@@ -1,6 +1,6 @@
-import { Component, Input, OnInit, ViewChild } from '@angular/core'
-import { ModalDirective } from 'ngx-bootstrap/modal'
+import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'
 import { VideoDetails } from '../../../shared/video/video-details.model'
+import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 
 @Component({
   selector: 'my-video-download',
@@ -10,25 +10,19 @@ import { VideoDetails } from '../../../shared/video/video-details.model'
 export class VideoDownloadComponent implements OnInit {
   @Input() video: VideoDetails = null
 
-  @ViewChild('modal') modal: ModalDirective
+  @ViewChild('modal') modal: ElementRef
 
   downloadType: 'direct' | 'torrent' | 'magnet' = 'torrent'
   resolutionId: number | string = -1
 
-  constructor () {
-    // empty
-  }
+  constructor (private modalService: NgbModal) { }
 
   ngOnInit () {
     this.resolutionId = this.video.files[0].resolution.id
   }
 
   show () {
-    this.modal.show()
-  }
-
-  hide () {
-    this.modal.hide()
+    this.modalService.open(this.modal)
   }
 
   download () {