]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/misc/help.component.ts
Use popover for help component
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / misc / help.component.ts
index 89dd1dae5b0a6d919b86aa8bbe65533dd9a074b5..9defd9aa4cc54920d397a2521e1cf96347f0a53e 100644 (file)
@@ -1,6 +1,5 @@
-import { Component, ElementRef, HostListener, Input, OnInit, ViewChild, OnChanges } from '@angular/core'
+import { Component, Input, OnChanges, OnInit } from '@angular/core'
 import { MarkdownService } from '@app/videos/shared'
-import { TooltipDirective } from 'ngx-bootstrap/tooltip'
 
 @Component({
   selector: 'my-help',
@@ -9,7 +8,6 @@ import { TooltipDirective } from 'ngx-bootstrap/tooltip'
 })
 
 export class HelpComponent implements OnInit, OnChanges {
-  @ViewChild('tooltipDirective') tooltipDirective: TooltipDirective
   @Input() preHtml = ''
   @Input() postHtml = ''
   @Input() customHtml = ''
@@ -17,8 +15,6 @@ export class HelpComponent implements OnInit, OnChanges {
 
   mainHtml = ''
 
-  constructor (private elementRef: ElementRef) { }
-
   ngOnInit () {
     this.init()
   }
@@ -27,15 +23,6 @@ export class HelpComponent implements OnInit, OnChanges {
     this.init()
   }
 
-  @HostListener('document:click', ['$event.target'])
-  public onClick (targetElement) {
-    const clickedInside = this.elementRef.nativeElement.contains(targetElement)
-
-    if (this.tooltipDirective.isOpen && !clickedInside) {
-      this.tooltipDirective.hide()
-    }
-  }
-
   private init () {
     if (this.helpType === 'custom') {
       this.mainHtml = this.customHtml