@limetech/lime-elements
Version:
21 lines (20 loc) • 596 B
JavaScript
const DEFAULT_DELAY_FOR_SHOWING = 500;
export class TooltipTimer {
constructor(showCallback, hideCallback, delayForShowing = DEFAULT_DELAY_FOR_SHOWING) {
this.timerHandle = null;
this.showCallback = showCallback;
this.hideCallback = hideCallback;
this.delayForShowing = delayForShowing;
}
showAfterDelay() {
if (!this.timerHandle) {
this.timerHandle = setTimeout(this.showCallback, this.delayForShowing);
}
}
hide() {
clearTimeout(this.timerHandle);
this.timerHandle = null;
this.hideCallback();
}
}
//# sourceMappingURL=tooltip-timer.js.map