Correct missing funcs

This commit is contained in:
2025-12-19 08:40:06 -05:00
parent ac29b6e929
commit dc6b551325
2 changed files with 47 additions and 2 deletions

View File

@@ -397,10 +397,10 @@ tbody tr:hover {
border-color: transparent #333 transparent transparent; border-color: transparent #333 transparent transparent;
} }
.notes-tooltip:hover .tooltip-text { /* .notes-tooltip:hover .tooltip-text {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
} } */
/* Modal Styles */ /* Modal Styles */
.modal { .modal {

View File

@@ -1129,6 +1129,14 @@
let currentUserId = null; let currentUserId = null;
let currentChangePasswordUserId = null; let currentChangePasswordUserId = null;
// ==================== GENERIC MODAL HELPER ====================
function closeModal(modalId, additionalCleanup = null) {
document.getElementById(modalId).style.display = 'none';
if (additionalCleanup) {
additionalCleanup();
}
}
// Load UI configuration from API // Load UI configuration from API
async function loadUIConfig() { async function loadUIConfig() {
try { try {
@@ -4769,13 +4777,50 @@
if (lookup) lookup.clear(); if (lookup) lookup.clear();
} }
// Position tooltip near mouse cursor
function positionTooltip(event) {
const tooltip = event.currentTarget.querySelector('.tooltip-text');
if (tooltip) {
const rect = tooltip.getBoundingClientRect();
const tooltipWidth = 300; // matches CSS width
const tooltipHeight = rect.height || 100; // estimate if not yet rendered
let left = event.pageX + 10;
let top = event.pageY + 10;
// Adjust if tooltip would go off screen
if (left + tooltipWidth > window.innerWidth) {
left = event.pageX - tooltipWidth - 10;
}
if (top + tooltipHeight > window.innerHeight) {
top = event.pageY - tooltipHeight - 10;
}
tooltip.style.left = left + 'px';
tooltip.style.top = top + 'px';
tooltip.style.visibility = 'visible';
tooltip.style.opacity = '1';
}
}
// Add hover listeners to all notes tooltips // Add hover listeners to all notes tooltips
function setupTooltips() { function setupTooltips() {
document.querySelectorAll('.notes-tooltip').forEach(tooltip => { document.querySelectorAll('.notes-tooltip').forEach(tooltip => {
tooltip.addEventListener('mouseenter', positionTooltip); tooltip.addEventListener('mouseenter', positionTooltip);
tooltip.addEventListener('mouseleave', hideTooltip);
}); });
} }
// Hide tooltip when mouse leaves
function hideTooltip(event) {
const tooltip = event.currentTarget.querySelector('.tooltip-text');
if (tooltip) {
tooltip.style.visibility = 'hidden';
tooltip.style.opacity = '0';
}
}
// Initialize the page when DOM is loaded // Initialize the page when DOM is loaded
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
loadUIConfig(); // Load UI configuration first loadUIConfig(); // Load UI configuration first