feat(nav): partial HTMX navigation — swap main content without full reload
Intercept internal links and load only .main-wrapper via htmx.ajax, keeping the sidebar/header shell in place. Adds history pushState/popstate handling, sidebar active-state resync and document title update. Moves page script blocks inside #main-content so they run on swap, and makes editor/board scripts idempotent. Routes navigateTo/breadcrumb/library/local-workspace through window.fdNavigate and fixes the duplicated navigateTo definition.
This commit is contained in:
@@ -1303,7 +1303,8 @@ function libraryPage() {
|
||||
// ── Item actions ──
|
||||
openItem(item) {
|
||||
if (!item || !item.id) return;
|
||||
window.location.href = '/pages/' + item.id;
|
||||
if (window.fdNavigate) window.fdNavigate('/pages/' + item.id);
|
||||
else window.location.href = '/pages/' + item.id;
|
||||
},
|
||||
|
||||
startRename(item) {
|
||||
@@ -1361,7 +1362,8 @@ function libraryPage() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
window.location.href = '/pages/' + d.id;
|
||||
if (window.fdNavigate) window.fdNavigate('/pages/' + d.id);
|
||||
else window.location.href = '/pages/' + d.id;
|
||||
}
|
||||
} catch(e) {
|
||||
if (window.showToast) window.showToast('Failed to create page', 'error');
|
||||
|
||||
Reference in New Issue
Block a user