1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/scripts/themeLoader.js

30 lines
851 B
JavaScript
Raw Normal View History

import * as userSettings from 'userSettings';
import skinManager from 'skinManager';
import connectionManager from 'connectionManager';
import events from 'events';
2019-10-08 01:29:47 +03:00
var currentViewType;
pageClassOn('viewbeforeshow', 'page', function () {
var classList = this.classList;
var viewType = classList.contains('type-interior') || classList.contains('wizardPage') ? 'a' : 'b';
2019-10-08 01:29:47 +03:00
if (viewType !== currentViewType) {
currentViewType = viewType;
var theme;
var context;
2019-10-08 01:29:47 +03:00
if ('a' === viewType) {
theme = userSettings.dashboardTheme();
context = 'serverdashboard';
} else {
theme = userSettings.theme();
2018-10-23 01:05:09 +03:00
}
skinManager.setTheme(theme, context);
}
2019-10-08 01:29:47 +03:00
});
events.on(connectionManager, 'localusersignedin', function (e, user) {
currentViewType = null;
});