</ng-template>
<span
- class="help-tooltip-button" containerClass="help-tooltip" title="Click to get help"
- #tooltipDirective="bs-tooltip" [tooltip]="tooltipTemplate" triggers="click"
+ class="help-tooltip-button"
+ [popover]="tooltipTemplate"
+ placement="right"
+ [outsideClick]="true"
></span>
}
/deep/ {
- .help-tooltip {
- opacity: 1 !important;
+ .popover-body {
+ text-align: left;
+ padding: 10px;
+ max-width: 300px;
- .tooltip-inner {
- text-align: left;
- padding: 10px;
- max-width: 300px;
-
- font-size: 13px;
- font-family: $main-fonts;
- background-color: #fff;
- color: #000;
- box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
- }
+ font-size: 13px;
+ font-family: $main-fonts;
+ background-color: #fff;
+ color: #000;
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
ul {
padding-left: 20px;
-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',
})
export class HelpComponent implements OnInit, OnChanges {
- @ViewChild('tooltipDirective') tooltipDirective: TooltipDirective
@Input() preHtml = ''
@Input() postHtml = ''
@Input() customHtml = ''
mainHtml = ''
- constructor (private elementRef: ElementRef) { }
-
ngOnInit () {
this.init()
}
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