feat: add dynamic page switcher dropdown in editor header and ensure exact page route rendering
All checks were successful
Production Build & Deploy / build-and-deploy (push) Successful in 49s
All checks were successful
Production Build & Deploy / build-and-deploy (push) Successful in 49s
This commit is contained in:
@@ -28,5 +28,5 @@
|
||||
"sections": []
|
||||
}
|
||||
],
|
||||
"updated_at": "2026-08-09T22:25:49.609Z"
|
||||
"updated_at": "2026-08-09T22:28:31.200Z"
|
||||
}
|
||||
@@ -64,12 +64,17 @@ const previewUrl = `${targetPage?.slug || "/"}?preview=draft`;
|
||||
></path></svg
|
||||
>
|
||||
</button>
|
||||
<span
|
||||
class="text-xs font-bold truncate max-w-[170px] text-slate-200"
|
||||
title={targetPage.title}
|
||||
<select
|
||||
id="editor-page-switcher"
|
||||
class="bg-[#262626] border border-[#333] hover:border-[#38bdf8] text-xs font-bold text-slate-200 rounded px-2 py-1 outline-none transition-colors max-w-[160px] cursor-pointer"
|
||||
title="Seite im Editor wechseln"
|
||||
>
|
||||
{targetPage.title}
|
||||
</span>
|
||||
{pages.map((p: any) => (
|
||||
<option value={p.id} selected={p.id === targetPage.id}>
|
||||
{p.title} ({p.slug})
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex items-center gap-1">
|
||||
<span
|
||||
@@ -957,6 +962,12 @@ const previewUrl = `${targetPage?.slug || "/"}?preview=draft`;
|
||||
});
|
||||
});
|
||||
|
||||
// Page Switcher Dropdown Handler
|
||||
document.getElementById("editor-page-switcher")?.addEventListener("change", (e: any) => {
|
||||
const selectedPageId = e.target.value;
|
||||
window.location.href = `/admin/editor/?page_id=${selectedPageId}`;
|
||||
});
|
||||
|
||||
// Page Settings Modal
|
||||
const modalPage = document.getElementById(
|
||||
"modal-page-settings",
|
||||
|
||||
Reference in New Issue
Block a user