Fix CSP-blocked chart scripts, undefined CSS classes, and double-firing click handlers
- Add nonce to charts and ticket-preview drawer inline <script> blocks in DashboardView.php (both were CSP-blocked — charts never rendered) - Add .lt-modal-xs (280px) to base.css — used by quickStatus/quickAssign modals but was undefined, causing them to use full modal width - Fix showConfirmModal in utils.js: class="text-center" → "lt-text-center" (undefined class); escape newlines as <br> so multi-line messages render - Remove duplicate click-handler cases from DashboardView.php inline script that were already handled by dashboard.js, preventing double-firing (export-tickets, open-settings, remove-filter, etc. were all called twice) - Fix manual-refresh action to use lt.autoRefresh.now() instead of bare window.location.reload() so modal/focus guards are respected Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -198,9 +198,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
case 'open-settings-modal':
|
||||
if (typeof openSettingsModal === 'function') openSettingsModal();
|
||||
break;
|
||||
// Refresh
|
||||
// Refresh — use lt.autoRefresh.now() so modal/focus guards are respected
|
||||
case 'manual-refresh':
|
||||
window.location.reload();
|
||||
if (window.lt && lt.autoRefresh) lt.autoRefresh.now();
|
||||
else window.location.reload();
|
||||
break;
|
||||
// Export
|
||||
case 'toggle-export-menu':
|
||||
|
||||
+3
-3
@@ -26,7 +26,7 @@ function showConfirmModal(title, message, type = 'warning', onConfirm, onCancel
|
||||
const color = colors[type] || colors.warning;
|
||||
const icon = icons[type] || icons.warning;
|
||||
const safeTitle = lt.escHtml(title);
|
||||
const safeMessage = lt.escHtml(message);
|
||||
const safeMessage = lt.escHtml(message).replace(/\n/g, '<br>');
|
||||
|
||||
document.body.insertAdjacentHTML('beforeend', `
|
||||
<div class="lt-modal-overlay" id="${modalId}" aria-hidden="true" role="dialog" aria-modal="true" aria-labelledby="${modalId}_title">
|
||||
@@ -35,8 +35,8 @@ function showConfirmModal(title, message, type = 'warning', onConfirm, onCancel
|
||||
<span class="lt-modal-title" id="${modalId}_title">${icon} ${safeTitle}</span>
|
||||
<button class="lt-modal-close" data-modal-close aria-label="Close">✕</button>
|
||||
</div>
|
||||
<div class="lt-modal-body text-center">
|
||||
<p class="modal-message">${safeMessage}</p>
|
||||
<div class="lt-modal-body lt-text-center">
|
||||
<p>${safeMessage}</p>
|
||||
</div>
|
||||
<div class="lt-modal-footer">
|
||||
<button class="lt-btn lt-btn-primary" id="${modalId}_confirm">CONFIRM</button>
|
||||
|
||||
Reference in New Issue
Block a user