Skip to content

Commit

Permalink
Name function more accurately
Browse files Browse the repository at this point in the history
  • Loading branch information
dancormier committed Aug 25, 2022
1 parent 844d5a3 commit 51d82c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/ts/controllers/s-tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class TooltipController extends BasePopoverController {
/**
* Cancels the scheduled tooltip popover display and hides it if already displayed
*/
hide(dispatcher: Event | Element | null = null) {
scheduleHide(dispatcher: Event | Element | null = null) {
window.clearTimeout(this.activeTimeout);
this.activeTimeout = window.setTimeout(() => super.hide(dispatcher), 100);
}
Expand Down Expand Up @@ -174,21 +174,21 @@ export class TooltipController extends BasePopoverController {
*/
private hideIfWithin(event: Event) {
if ((<Element>event.target!).contains(this.referenceElement)) {
this.hide();
this.scheduleHide();
}
}

private hideOnEscapeKeyEvent(event: KeyboardEvent) {
if (event.key === "Escape") {
this.hide();
this.scheduleHide();
}
}
/**
* Binds mouse events to show/hide on reference element hover
*/
private bindKeyboardEvents() {
this.boundScheduleShow = this.boundScheduleShow || this.scheduleShow.bind(this);
this.boundHide = this.boundHide || this.hide.bind(this);
this.boundHide = this.boundHide || this.scheduleHide.bind(this);
this.boundHideOnEscapeKeyEvent = this.boundHideOnEscapeKeyEvent || this.hideOnEscapeKeyEvent.bind(this);

this.referenceElement.addEventListener("focus", this.boundScheduleShow);
Expand All @@ -210,7 +210,7 @@ export class TooltipController extends BasePopoverController {
*/
private bindMouseEvents() {
this.boundScheduleShow = this.boundScheduleShow || this.scheduleShow.bind(this);
this.boundHide = this.boundHide || this.hide.bind(this);
this.boundHide = this.boundHide || this.scheduleHide.bind(this);
this.boundClearActiveTimeout = this.boundClearActiveTimeout || this.clearActiveTimeout.bind(this);

this.referenceElement.addEventListener("mouseover", this.boundScheduleShow);
Expand Down

0 comments on commit 51d82c3

Please sign in to comment.