mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-13 01:57:07 -07:00
WebUI: fix color scheme for iframes
Applies the color scheme for iframe dialogs. Fixup for #21613. PR #21750.
This commit is contained in:
parent
fe153f8919
commit
06fe3e5fb0
29 changed files with 133 additions and 38 deletions
|
@ -1760,19 +1760,6 @@ window.addEventListener("load", () => {
|
|||
window.qBittorrent.Cache.preferences.init();
|
||||
window.qBittorrent.Cache.qbtVersion.init();
|
||||
|
||||
// Setup color scheme switching
|
||||
const colorSchemeQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
const updateColorScheme = () => {
|
||||
const root = document.documentElement;
|
||||
const colorScheme = LocalPreferences.get("color_scheme");
|
||||
const validScheme = (colorScheme === "light") || (colorScheme === "dark");
|
||||
const isDark = colorSchemeQuery.matches;
|
||||
root.classList.toggle("dark", ((!validScheme && isDark) || (colorScheme === "dark")));
|
||||
};
|
||||
|
||||
colorSchemeQuery.addEventListener("change", updateColorScheme);
|
||||
updateColorScheme();
|
||||
|
||||
// switch to previously used tab
|
||||
const previouslyUsedTab = LocalPreferences.get("selected_window_tab", "transfers");
|
||||
switch (previouslyUsedTab) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue