Add command palette (Ctrl+K / Cmd+K) globally
Adds lt-cmd-overlay HTML to layout_header.php and initializes lt.cmdPalette with commands for: navigation (Dashboard, New Ticket), filters (My Tickets, Unassigned, P1 Critical), admin pages (if admin), and recent tickets (last 5 viewed, stored in localStorage). TicketView.php records each viewed ticket ID to localStorage under lt_recent_tickets so the command palette can surface them as Recent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -120,6 +120,16 @@ window.ticketData = {
|
||||
};
|
||||
window.ticketData.id = window.ticketData.ticket_id;
|
||||
if (window.lt) lt.keys.initDefaults();
|
||||
// Track recently viewed tickets for command palette
|
||||
(function() {
|
||||
try {
|
||||
var tid = String(window.ticketData.ticket_id);
|
||||
var key = 'lt_recent_tickets';
|
||||
var r = JSON.parse(localStorage.getItem(key) || '[]');
|
||||
r = [tid].concat(r.filter(function(x){ return x !== tid; })).slice(0, 5);
|
||||
localStorage.setItem(key, JSON.stringify(r));
|
||||
} catch(_) {}
|
||||
})();
|
||||
JS;
|
||||
|
||||
include __DIR__ . '/layout_header.php';
|
||||
|
||||
Reference in New Issue
Block a user