added error marker for each collection tab and fixed the styles of the raw errors tooltip

This commit is contained in:
Gani Georgiev
2026-05-14 09:15:05 +03:00
parent b061673d9a
commit 820b9afe98
13 changed files with 103 additions and 25 deletions
+6 -5
View File
@@ -7,9 +7,10 @@ const tooltip = t.div({
});
document.body.appendChild(tooltip);
function updateTooltipPosition(node, position) {
function updateTooltipPosition(node, position, styleClass) {
let nodeRect = node.getBoundingClientRect();
tooltip.setAttribute("data-style", styleClass || "");
tooltip.setAttribute("data-position", position);
// reset tooltip position
@@ -76,7 +77,7 @@ function hideTooltip() {
tooltip.hidePopover();
}
function showTooltip(node, text, position) {
function showTooltip(node, text, position, styleClass) {
if (!node || !text) {
hideTooltip();
return;
@@ -84,14 +85,14 @@ function showTooltip(node, text, position) {
tooltip.showPopover();
tooltip.textContent = text;
updateTooltipPosition(node, position);
updateTooltipPosition(node, position, styleClass);
}
document.body.addEventListener("mouseleave", () => {
hideTooltip();
});
function tooltipAction(textOrFunc, position = "top") {
function tooltipAction(textOrFunc, position = "top", styleClass = "") {
return (el) => {
if (!el._tooltipText) {
el._tooltipText = store({
@@ -105,7 +106,7 @@ function tooltipAction(textOrFunc, position = "top") {
tooltipTextWatcher = watch(
() => el._tooltipText.value,
async (result) => {
showTooltip(el, result, position);
showTooltip(el, result, position, styleClass);
},
);
}