tooltip.js updated

pull/3845/head
Furkan Sezis 2023-04-10 11:01:28 +03:00
parent c3cd42a317
commit bcac4b7776
1 changed files with 32 additions and 32 deletions

View File

@ -1,5 +1,7 @@
import { ConnectedOverlayScrollHandler, DomHandler, ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primevue/utils';
let timer;
function bindEvents(el) {
const modifiers = el.$_ptooltipModifiers;
@ -86,10 +88,7 @@ function onKeydown(event) {
event.code === 'Escape' && hide(event.currentTarget, hideDelay);
}
let timer;
function show(el, showDelay) {
function tooltipActions() {
function tooltipActions(el) {
if (el.$_ptooltipDisabled) {
return;
}
@ -111,25 +110,26 @@ function show(el, showDelay) {
ZIndexUtils.set('tooltip', tooltipElement, el.$_ptooltipZIndex);
}
function show(el, showDelay) {
if (showDelay !== undefined) {
timer = setTimeout(tooltipActions, showDelay);
timer = setTimeout(() => tooltipActions(el), showDelay);
} else {
tooltipActions();
tooltipActions(el);
}
}
function hide(el, hideDelay) {
function tooltipRemoval() {
function tooltipRemoval(el) {
remove(el);
unbindScrollListener(el);
}
function hide(el, hideDelay) {
clearTimeout(timer);
if (hideDelay !== undefined) {
setTimeout(tooltipRemoval, hideDelay);
setTimeout(() => tooltipRemoval(el), hideDelay);
} else {
tooltipRemoval();
tooltipRemoval(el);
}
}