fix: popout theme inheritance via URL query param
- Pass current theme as ?theme=dark|light in popout URL - viewer.js, app.js, palette.js all pass theme to popout - popout.html reads theme from URL param first (fallback: localStorage, then dark) - Also syncs theme back to localStorage when set via query param
This commit is contained in:
@@ -571,7 +571,8 @@ export function renderFile(data) {
|
||||
|
||||
const openNewWindowBtn = el("button", { class: "btn-action", title: t("forge.popout") }, [icon("external-link", 14), document.createTextNode(t("forge.popout_label"))]);
|
||||
openNewWindowBtn.addEventListener("click", () => {
|
||||
const popoutUrl = `/popout/${encodeURIComponent(data.vault)}/${encodeURIComponent(data.path)}`;
|
||||
const theme = document.documentElement.getAttribute('data-theme') || 'dark';
|
||||
const popoutUrl = `/popout/${encodeURIComponent(data.vault)}/${encodeURIComponent(data.path)}?theme=${theme}`;
|
||||
window.open(popoutUrl, `popout_${data.vault}_${data.path.replace(/[^a-zA-Z0-9]/g, "_")}`, "width=1000,height=700,menubar=no,toolbar=no,location=no,status=no,resizable=yes,scrollbars=no");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user