Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed May 8, 2024
1 parent 708498c commit 7ce0541
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/components/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class Tooltip implements AfterViewInit, OnDestroy {
* Event to show the tooltip.
* @group Props
*/
@Input() tooltipEvent: 'hover' | 'focus' | 'combined' | string | any = 'hover';
@Input() tooltipEvent: 'hover' | 'focus' | 'both' | string | any = 'hover';
/**
* Target element to attach the overlay, valid values are "body", "target" or a local ng-F variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name).
* @group Props
Expand Down Expand Up @@ -171,15 +171,15 @@ export class Tooltip implements AfterViewInit, OnDestroy {
this.zone.runOutsideAngular(() => {
const tooltipEvent = this.getOption('tooltipEvent');

if (tooltipEvent === 'hover' || tooltipEvent === 'combined') {
if (tooltipEvent === 'hover' || tooltipEvent === 'both') {
this.mouseEnterListener = this.onMouseEnter.bind(this);
this.mouseLeaveListener = this.onMouseLeave.bind(this);
this.clickListener = this.onInputClick.bind(this);
this.el.nativeElement.addEventListener('mouseenter', this.mouseEnterListener);
this.el.nativeElement.addEventListener('click', this.clickListener);
this.el.nativeElement.addEventListener('mouseleave', this.mouseLeaveListener);
}
if (tooltipEvent === 'focus' || tooltipEvent === 'combined') {
if (tooltipEvent === 'focus' || tooltipEvent === 'both') {
this.focusListener = this.onFocus.bind(this);
this.blurListener = this.onBlur.bind(this);

Expand Down Expand Up @@ -638,12 +638,12 @@ export class Tooltip implements AfterViewInit, OnDestroy {
unbindEvents() {
const tooltipEvent = this.getOption('tooltipEvent');

if (tooltipEvent === 'hover' || tooltipEvent === 'combined') {
if (tooltipEvent === 'hover' || tooltipEvent === 'both') {
this.el.nativeElement.removeEventListener('mouseenter', this.mouseEnterListener);
this.el.nativeElement.removeEventListener('mouseleave', this.mouseLeaveListener);
this.el.nativeElement.removeEventListener('click', this.clickListener);
}
if (tooltipEvent === 'focus' || tooltipEvent === 'combined') {
if (tooltipEvent === 'focus' || tooltipEvent === 'both') {
let target = this.getTarget(this.el.nativeElement);

target.removeEventListener('focus', this.focusListener);
Expand Down

0 comments on commit 7ce0541

Please sign in to comment.