contact tooltip issue

This commit is contained in:
Chen Lily 2023-06-06 13:50:05 +08:00
parent 99d4aa59a8
commit c045aac4f9
3 changed files with 17 additions and 8 deletions

View File

@ -908,6 +908,10 @@ class CustomerCommunication {
div.innerText = r('contactInformation', 'Contact Information');
}),
createElement('div', div => {
if (option.contactCollapserVisible === false) {
div.style.display = 'none';
return;
}
if (option.contactCollapsed) {
container.classList.add('collapsed');
div.className = 'bar-collapser collapsed';

View File

@ -152,7 +152,8 @@
.bar-list-container {
min-height: 26px;
max-height: 120px;
overflow: auto;
overflow-x: hidden;
overflow-y: auto;
position: relative;
}

View File

@ -106,13 +106,15 @@ function setTooltip(container, content, flag = false, parent = null) {
p = p.parentElement;
}
}
wrapper.style.display = '';
const offsetHeight = wrapper.offsetHeight;
if (t - offsetHeight - 14 < 0) {
if (t + offsetHeight + 2 > lastHeight) {
top = lastHeight - offsetHeight + 2;
const parentOffsetHeight = c.parentElement.offsetHeight;
if (t + parentOffsetHeight + offsetHeight + 10 > lastHeight) {
top = lastHeight - offsetHeight - 2;
wrapper.classList.add('ui-tooltip-no');
} else {
top += c.parentElement.offsetHeight + 10;
top += parentOffsetHeight + 10;
wrapper.classList.add('ui-tooltip-down');
}
} else {
@ -126,10 +128,11 @@ function setTooltip(container, content, flag = false, parent = null) {
} else if (left + offsetWidth + 2 > lastWidth) {
left = lastWidth - offsetWidth - 2;
}
wrapper.style.left = `${left}px`;
wrapper.style.top = `${top}px`;
wrapper.style.visibility = 'visible';
wrapper.style.opacity = 1;
// wrapper.style.left = `${left}px`;
// wrapper.style.top = `${top}px`;
// wrapper.style.visibility = 'visible';
// wrapper.style.opacity = 1;
wrapper.style.cssText += `left: ${left}px; top: ${top}px; visibility: visible; opacity: 1`;
}, 100);
}
});
@ -138,6 +141,7 @@ function setTooltip(container, content, flag = false, parent = null) {
tid = setTimeout(() => {
wrapper.style.visibility = 'hidden';
wrapper.style.opacity = 0;
tid = setTimeout(() => wrapper.style.display = 'none', 120);
}, 300);
});
return container;