Update reference docs: fix event names, add demos, document sx-boost target
- Remove sx:afterSettle (not dispatched), rename sx:sendError → sx:requestError - Add sx:clientRoute event (Phase 3 client-side routing) - Add working demos for all 10 events (afterRequest, afterSwap, requestError, clientRoute, sseOpen, sseMessage, sseError were missing demos) - Update sx-boost docs: configurable target selector, client routing behavior - Remove app-specific nav logic from orchestration.sx, use sx:clientRoute event - Pass page content deps to sx_response for component loading after server fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -737,6 +737,26 @@ document.body.addEventListener('click', function (e) {
|
||||
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Client-side route nav selection
|
||||
// - Updates aria-selected on sub-nav links after client-side routing
|
||||
// - Scoped to <nav> elements (top-level section links are outside <nav>)
|
||||
// ============================================================================
|
||||
|
||||
document.body.addEventListener('sx:clientRoute', function (e) {
|
||||
var pathname = e.detail && e.detail.pathname;
|
||||
if (!pathname) return;
|
||||
// Deselect all sub-nav links (inside <nav> elements)
|
||||
document.querySelectorAll('nav a[aria-selected]').forEach(function (a) {
|
||||
a.setAttribute('aria-selected', 'false');
|
||||
});
|
||||
// Select the matching link
|
||||
document.querySelectorAll('nav a[href="' + pathname + '"]').forEach(function (a) {
|
||||
a.setAttribute('aria-selected', 'true');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Scrolling menu arrow visibility (replaces hyperscript scroll/load handlers)
|
||||
// Elements with data-scroll-arrows="arrow-class" show/hide arrows on overflow.
|
||||
|
||||
Reference in New Issue
Block a user