2020-06-16 18:46:54 +01:00
|
|
|
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
|
|
|
|
2020-06-16 18:46:54 +01: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
|
|
|
|
2020-06-16 18:46:54 +01:00
|
|
|
if (viewType !== currentViewType) {
|
|
|
|
currentViewType = viewType;
|
|
|
|
var theme;
|
|
|
|
var context;
|
2019-10-08 01:29:47 +03:00
|
|
|
|
2020-07-30 16:07:13 +02:00
|
|
|
if (viewType === 'a') {
|
2020-06-16 18:46:54 +01:00
|
|
|
theme = userSettings.dashboardTheme();
|
|
|
|
context = 'serverdashboard';
|
|
|
|
} else {
|
|
|
|
theme = userSettings.theme();
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2020-06-16 18:46:54 +01:00
|
|
|
|
|
|
|
skinManager.setTheme(theme, context);
|
|
|
|
}
|
2019-10-08 01:29:47 +03:00
|
|
|
});
|
2020-06-16 18:46:54 +01:00
|
|
|
|
|
|
|
events.on(connectionManager, 'localusersignedin', function (e, user) {
|
|
|
|
currentViewType = null;
|
|
|
|
});
|