]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/modal/video-share.component.ts
Fix scrolling with hash in url
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / modal / video-share.component.ts
index a9a7a0eabd63e9a3023d702ec3f95eb094599c4b..3550556a0273ff483b2acf3dcea767004f091a47 100644 (file)
@@ -1,9 +1,7 @@
 import { Component, ElementRef, Input, ViewChild } from '@angular/core'
-import { Notifier } from '@app/core'
 import { VideoDetails } from '../../../shared/video/video-details.model'
 import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils'
-import { I18n } from '@ngx-translate/i18n-polyfill'
-import { NgbModal, NgbTabChangeEvent } from '@ng-bootstrap/ng-bootstrap'
+import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 import { VideoCaption } from '@shared/models'
 import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
 
@@ -37,7 +35,7 @@ export class VideoShareComponent {
   @Input() videoCaptions: VideoCaption[] = []
   @Input() playlist: VideoPlaylist = null
 
-  activeId: 'url' | 'qrcode' | 'embed'
+  activeId: 'url' | 'qrcode' | 'embed' = 'url'
   customizations: Customizations
   isAdvancedCustomizationCollapsed = true
   includeVideoInPlaylist = false
@@ -74,7 +72,7 @@ export class VideoShareComponent {
       controls: true
     }
 
-    this.modalService.open(this.modal)
+    this.modalService.open(this.modal, { centered: true })
   }
 
   getVideoIframeCode () {
@@ -96,17 +94,13 @@ export class VideoShareComponent {
 
     if (!this.includeVideoInPlaylist) return base
 
-    return base  + '?videoId=' + this.video.uuid
+    return base + '?videoId=' + this.video.uuid
   }
 
   notSecure () {
     return window.location.protocol === 'http:'
   }
 
-  onTabChange (event: NgbTabChangeEvent) {
-    this.activeId = event.nextId as any
-  }
-
   isInEmbedTab () {
     return this.activeId === 'embed'
   }