Correct missing funcs
This commit is contained in:
@@ -397,10 +397,10 @@ tbody tr:hover {
|
||||
border-color: transparent #333 transparent transparent;
|
||||
}
|
||||
|
||||
.notes-tooltip:hover .tooltip-text {
|
||||
/* .notes-tooltip:hover .tooltip-text {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
} */
|
||||
|
||||
/* Modal Styles */
|
||||
.modal {
|
||||
|
||||
@@ -1129,6 +1129,14 @@
|
||||
let currentUserId = 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
|
||||
async function loadUIConfig() {
|
||||
try {
|
||||
@@ -4769,13 +4777,50 @@
|
||||
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
|
||||
function setupTooltips() {
|
||||
document.querySelectorAll('.notes-tooltip').forEach(tooltip => {
|
||||
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
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
loadUIConfig(); // Load UI configuration first
|
||||
|
||||
Reference in New Issue
Block a user