diff options
Diffstat (limited to 'client/src/app/shared/misc/help.component.ts')
-rw-r--r-- | client/src/app/shared/misc/help.component.ts | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/misc/help.component.ts index 89dd1dae5..0373a63de 100644 --- a/client/src/app/shared/misc/help.component.ts +++ b/client/src/app/shared/misc/help.component.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Component, ElementRef, HostListener, Input, OnInit, ViewChild, OnChanges } from '@angular/core' | 1 | import { Component, Input, OnChanges, OnInit } from '@angular/core' |
2 | import { MarkdownService } from '@app/videos/shared' | 2 | import { MarkdownService } from '@app/videos/shared' |
3 | import { TooltipDirective } from 'ngx-bootstrap/tooltip' | ||
4 | 3 | ||
5 | @Component({ | 4 | @Component({ |
6 | selector: 'my-help', | 5 | selector: 'my-help', |
@@ -9,16 +8,14 @@ import { TooltipDirective } from 'ngx-bootstrap/tooltip' | |||
9 | }) | 8 | }) |
10 | 9 | ||
11 | export class HelpComponent implements OnInit, OnChanges { | 10 | export class HelpComponent implements OnInit, OnChanges { |
12 | @ViewChild('tooltipDirective') tooltipDirective: TooltipDirective | ||
13 | @Input() preHtml = '' | 11 | @Input() preHtml = '' |
14 | @Input() postHtml = '' | 12 | @Input() postHtml = '' |
15 | @Input() customHtml = '' | 13 | @Input() customHtml = '' |
16 | @Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom' | 14 | @Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom' |
15 | @Input() tooltipPlacement = 'right' | ||
17 | 16 | ||
18 | mainHtml = '' | 17 | mainHtml = '' |
19 | 18 | ||
20 | constructor (private elementRef: ElementRef) { } | ||
21 | |||
22 | ngOnInit () { | 19 | ngOnInit () { |
23 | this.init() | 20 | this.init() |
24 | } | 21 | } |
@@ -27,15 +24,6 @@ export class HelpComponent implements OnInit, OnChanges { | |||
27 | this.init() | 24 | this.init() |
28 | } | 25 | } |
29 | 26 | ||
30 | @HostListener('document:click', ['$event.target']) | ||
31 | public onClick (targetElement) { | ||
32 | const clickedInside = this.elementRef.nativeElement.contains(targetElement) | ||
33 | |||
34 | if (this.tooltipDirective.isOpen && !clickedInside) { | ||
35 | this.tooltipDirective.hide() | ||
36 | } | ||
37 | } | ||
38 | |||
39 | private init () { | 27 | private init () { |
40 | if (this.helpType === 'custom') { | 28 | if (this.helpType === 'custom') { |
41 | this.mainHtml = this.customHtml | 29 | this.mainHtml = this.customHtml |