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