This commit is contained in:
Timothy J. Baek 2024-10-05 03:21:22 -07:00
parent fe7e7abf15
commit 2e231982a3

View File

@ -27,13 +27,16 @@
// Adjust based on parent rect // Adjust based on parent rect
const top = rect.bottom - parentRect.top; const top = rect.bottom - parentRect.top;
const left = rect.left - parentRect.left; const left = rect.left - parentRect.left;
if (buttonsContainerElement) {
buttonsContainerElement.style.display = 'block'; buttonsContainerElement.style.display = 'block';
buttonsContainerElement.style.left = `${left}px`; buttonsContainerElement.style.left = `${left}px`;
buttonsContainerElement.style.top = `${top + 5}px`; // +5 to add some spacing buttonsContainerElement.style.top = `${top + 5}px`; // +5 to add some spacing
}
} else { } else {
if (buttonsContainerElement) {
buttonsContainerElement.style.display = 'none'; buttonsContainerElement.style.display = 'none';
} }
}
}, 0); }, 0);
}; };