fix: toast crash, notification dropdown, ticket detail editable, toolbar dropdowns
- Fix duplicate function showToast declaration causing infinite recursion (showToast declared twice → function hoisting → _origShowToast === self) Progress bar now inlined directly into _displayToast; Module 47 removed - Notification bell now opens a proper dropdown panel with unread items, per-item click-to-read, "Mark all read", close on outside click/Esc - Ticket detail drawer now has real editable fields (title, status, priority, assignee, description textarea, comment box) instead of read-only KV pairs; Save Changes and Post Comment buttons functional - Advanced ▾ filter dropdown: status/priority/assignee selects + Apply/Reset - Bulk Actions dropdown: Close/Reassign/Export/Delete with toast feedback - Generic .lt-dropdown-trigger toggle system (works for any future dropdown) - Add CSS sections 76 (notification panel) and 77 (dropdown widget + .lt-textarea) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -105,9 +105,14 @@
|
||||
closeEl.setAttribute('aria-label', 'Dismiss');
|
||||
closeEl.addEventListener('click', () => _dismissToast(toast));
|
||||
|
||||
const progressEl = document.createElement('div');
|
||||
progressEl.className = 'lt-toast-progress';
|
||||
progressEl.style.animationDuration = duration + 'ms';
|
||||
|
||||
toast.appendChild(iconEl);
|
||||
toast.appendChild(msgEl);
|
||||
toast.appendChild(closeEl);
|
||||
toast.appendChild(progressEl);
|
||||
container.appendChild(toast);
|
||||
|
||||
const timer = setTimeout(() => _dismissToast(toast), duration);
|
||||
@@ -2027,32 +2032,6 @@
|
||||
},
|
||||
};
|
||||
|
||||
/* ================================================================
|
||||
MODULE 47 — TOAST ENHANCEMENTS
|
||||
Adds a drain progress bar to each toast.
|
||||
The original showToast already handles queuing (section 2).
|
||||
================================================================ */
|
||||
// Patch showToast to inject a progress bar after each toast is created
|
||||
const _origShowToast = showToast;
|
||||
function showToast(message, type, duration) {
|
||||
duration = duration || 4000;
|
||||
const result = _origShowToast(message, type, duration);
|
||||
// Inject drain bar into the most recently added toast
|
||||
requestAnimationFrame(() => {
|
||||
const container = document.getElementById('lt-toast-container');
|
||||
if (!container) return;
|
||||
const toasts = container.querySelectorAll('.lt-toast');
|
||||
const last = toasts[toasts.length - 1];
|
||||
if (last && !last.querySelector('.lt-toast-progress')) {
|
||||
const bar = document.createElement('div');
|
||||
bar.className = 'lt-toast-progress';
|
||||
bar.style.animationDuration = duration + 'ms';
|
||||
last.appendChild(bar);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
MODULE 48 — SIDEBAR SUBMENUS
|
||||
Auto-inits .lt-sidebar-group elements.
|
||||
|
||||
Reference in New Issue
Block a user