moved tab change to theme picker file

This commit is contained in:
Miodec 2022-03-14 00:53:41 +01:00
parent eb4bb28c6c
commit 939a1b6e27
2 changed files with 10 additions and 10 deletions

View file

@ -102,18 +102,8 @@ function apply(themeName: string, isCustom: boolean, isPreview = false): void {
let name = "serika_dark";
if (!isCustom) {
name = themeName;
Misc.swapElements(
$('.pageSettings [tabContent="custom"]'),
$('.pageSettings [tabContent="preset"]'),
250
);
} else {
name = "custom";
Misc.swapElements(
$('.pageSettings [tabContent="preset"]'),
$('.pageSettings [tabContent="custom"]'),
250
);
}
ThemeColors.reset();

View file

@ -252,12 +252,22 @@ export function updateActiveTab(forced = false): void {
$customTabButton.addClass("active");
refreshButtons();
}
Misc.swapElements(
$('.pageSettings [tabContent="preset"]'),
$('.pageSettings [tabContent="custom"]'),
250
);
} else {
$customTabButton.removeClass("active");
if (!$presetTabButton.hasClass("active") || forced) {
$presetTabButton.addClass("active");
refreshButtons();
}
Misc.swapElements(
$('.pageSettings [tabContent="custom"]'),
$('.pageSettings [tabContent="preset"]'),
250
);
}
}