Fix linting
This commit is contained in:
@@ -126,18 +126,18 @@ export default function DocumentManager() {
|
|||||||
// Add tooltip position adjustment based on mouse position
|
// Add tooltip position adjustment based on mouse position
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!docs) return;
|
if (!docs) return;
|
||||||
|
|
||||||
// Function to handle mouse movement
|
// Function to handle mouse movement
|
||||||
const handleMouseMove = (event: MouseEvent) => {
|
const handleMouseMove = (event: MouseEvent) => {
|
||||||
const cardContent = document.querySelector<HTMLElement>('.flex-1.relative.p-0');
|
const cardContent = document.querySelector<HTMLElement>('.flex-1.relative.p-0');
|
||||||
if (!cardContent) return;
|
if (!cardContent) return;
|
||||||
|
|
||||||
const cardRect = cardContent.getBoundingClientRect();
|
const cardRect = cardContent.getBoundingClientRect();
|
||||||
const cardMiddleY = cardRect.top + cardRect.height / 2;
|
const cardMiddleY = cardRect.top + cardRect.height / 2;
|
||||||
|
|
||||||
// Get all visible tooltips
|
// Get all visible tooltips
|
||||||
const visibleTooltips = document.querySelectorAll<HTMLElement>('.group:hover > div[class*="invisible group-hover:visible absolute"]');
|
const visibleTooltips = document.querySelectorAll<HTMLElement>('.group:hover > div[class*="invisible group-hover:visible absolute"]');
|
||||||
|
|
||||||
visibleTooltips.forEach(tooltip => {
|
visibleTooltips.forEach(tooltip => {
|
||||||
// If mouse is in the bottom half of the card, show tooltip above
|
// If mouse is in the bottom half of the card, show tooltip above
|
||||||
if (event.clientY > cardMiddleY) {
|
if (event.clientY > cardMiddleY) {
|
||||||
@@ -147,10 +147,10 @@ export default function DocumentManager() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add mouse move listener to the document
|
// Add mouse move listener to the document
|
||||||
document.addEventListener('mousemove', handleMouseMove);
|
document.addEventListener('mousemove', handleMouseMove);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.removeEventListener('mousemove', handleMouseMove);
|
document.removeEventListener('mousemove', handleMouseMove);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user