aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/misc
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r--client/src/app/shared/misc/help.component.html7
-rw-r--r--client/src/app/shared/misc/help.component.scss22
-rw-r--r--client/src/app/shared/misc/help.component.ts16
3 files changed, 16 insertions, 29 deletions
diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.html
index e37d93b62..3da5701a0 100644
--- a/client/src/app/shared/misc/help.component.html
+++ b/client/src/app/shared/misc/help.component.html
@@ -13,6 +13,9 @@
13</ng-template> 13</ng-template>
14 14
15<span 15<span
16 class="help-tooltip-button" containerClass="help-tooltip" title="Click to get help" 16 class="help-tooltip-button"
17 #tooltipDirective="bs-tooltip" [tooltip]="tooltipTemplate" triggers="click" 17 title="Get help"
18 [popover]="tooltipTemplate"
19 [placement]="tooltipPlacement"
20 [outsideClick]="true"
18></span> 21></span>
diff --git a/client/src/app/shared/misc/help.component.scss b/client/src/app/shared/misc/help.component.scss
index b8bf3a7a5..0df8b86fa 100644
--- a/client/src/app/shared/misc/help.component.scss
+++ b/client/src/app/shared/misc/help.component.scss
@@ -12,20 +12,16 @@
12} 12}
13 13
14/deep/ { 14/deep/ {
15 .help-tooltip { 15 .popover-body {
16 opacity: 1 !important; 16 text-align: left;
17 padding: 10px;
18 max-width: 300px;
17 19
18 .tooltip-inner { 20 font-size: 13px;
19 text-align: left; 21 font-family: $main-fonts;
20 padding: 10px; 22 background-color: #fff;
21 max-width: 300px; 23 color: #000;
22 24 box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
23 font-size: 13px;
24 font-family: $main-fonts;
25 background-color: #fff;
26 color: #000;
27 box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
28 }
29 25
30 ul { 26 ul {
31 padding-left: 20px; 27 padding-left: 20px;
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 @@
1import { Component, ElementRef, HostListener, Input, OnInit, ViewChild, OnChanges } from '@angular/core' 1import { Component, Input, OnChanges, OnInit } from '@angular/core'
2import { MarkdownService } from '@app/videos/shared' 2import { MarkdownService } from '@app/videos/shared'
3import { 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
11export class HelpComponent implements OnInit, OnChanges { 10export 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