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:
@@ -5,7 +5,13 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>ObsiGate - Popout</title>
|
||||
<script>
|
||||
document.documentElement.setAttribute('data-theme', localStorage.getItem('obsigate-theme') || 'dark');
|
||||
// Inherit theme from opener or localStorage — query param has priority
|
||||
(function() {
|
||||
var m = location.search.match(/theme=([^&]+)/);
|
||||
var theme = (m && m[1]) || localStorage.getItem('obsigate-theme') || 'dark';
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
if (m && m[1]) { localStorage.setItem('obsigate-theme', theme); }
|
||||
})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/static/style.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user