mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixed bugs for default theme handling
fixed import for headroom.js
This commit is contained in:
parent
194bbf1ff1
commit
b23e625c20
3 changed files with 30 additions and 17 deletions
|
@ -1,4 +1,4 @@
|
|||
import * as webSettings from './settings/webSettings';
|
||||
import { getDefaultTheme, getThemes as getConfiguredThemes } from './settings/webSettings';
|
||||
|
||||
let themeStyleElement = document.querySelector('#cssTheme');
|
||||
let currentThemeId;
|
||||
|
@ -12,14 +12,22 @@ function unloadTheme() {
|
|||
}
|
||||
|
||||
function getThemes() {
|
||||
return webSettings.getThemes();
|
||||
return getConfiguredThemes();
|
||||
}
|
||||
|
||||
function getThemeStylesheetInfo(id) {
|
||||
return getThemes().then(themes => {
|
||||
const theme = themes.find(theme => {
|
||||
return id ? theme.id === id : theme.default;
|
||||
});
|
||||
let theme;
|
||||
|
||||
if (id) {
|
||||
theme = themes.find(theme => {
|
||||
return theme.id === id;
|
||||
});
|
||||
}
|
||||
|
||||
if (!theme) {
|
||||
theme = getDefaultTheme();
|
||||
}
|
||||
|
||||
return {
|
||||
stylesheetPath: 'themes/' + theme.id + '/theme.css',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue