File size: 1,351 Bytes
175d7e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Initialize tooltips
document.addEventListener('DOMContentLoaded', function() {
    // Initialize any tooltips if needed
    const tooltipTriggers = document.querySelectorAll('[data-tooltip]');
    
    tooltipTriggers.forEach(trigger => {
        const tooltipText = trigger.getAttribute('data-tooltip');
        const tooltip = document.createElement('div');
        tooltip.className = 'hidden absolute z-50 bg-gray-900 text-white text-xs rounded py-1 px-2';
        tooltip.textContent = tooltipText;
        trigger.appendChild(tooltip);
        
        trigger.addEventListener('mouseenter', () => {
            tooltip.classList.remove('hidden');
            tooltip.classList.add('block');
        });
        
        trigger.addEventListener('mouseleave', () => {
            tooltip.classList.remove('block');
            tooltip.classList.add('hidden');
        });
    });
    
    // Simulate loading data
    setTimeout(() => {
        const loadingElements = document.querySelectorAll('.skeleton');
        loadingElements.forEach(el => {
            el.classList.remove('skeleton');
        });
    }, 1500);
});

// Delivery status update function
function updateDeliveryStatus(deliveryId, newStatus) {
    console.log(`Updating delivery ${deliveryId} to status: ${newStatus}`);
    // In a real app, this would make an API call
}