mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
fix: auto apply icon only sidebar on load
This commit is contained in:
@@ -486,7 +486,6 @@ body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) {
|
|||||||
|
|
||||||
#menu ul li,
|
#menu ul li,
|
||||||
#menu ul section {
|
#menu ul section {
|
||||||
width: 100% !important;
|
|
||||||
min-width: 0 !important;
|
min-width: 0 !important;
|
||||||
max-width: 100% !important;
|
max-width: 100% !important;
|
||||||
padding: 8px !important;
|
padding: 8px !important;
|
||||||
|
|||||||
@@ -612,7 +612,15 @@ export function init() {
|
|||||||
if (settingsState.onoff) {
|
if (settingsState.onoff) {
|
||||||
console.info("[BetterSEQTA+] Enabled");
|
console.info("[BetterSEQTA+] Enabled");
|
||||||
if (settingsState.DarkMode) document.documentElement.classList.add("dark");
|
if (settingsState.DarkMode) document.documentElement.classList.add("dark");
|
||||||
if (settingsState.iconOnlySidebar) document.body.classList.add("icon-only-sidebar");
|
if (settingsState.iconOnlySidebar) {
|
||||||
|
if (document.body) {
|
||||||
|
document.body.classList.add("icon-only-sidebar");
|
||||||
|
} else {
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
document.body?.classList.add("icon-only-sidebar");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.querySelector(".legacy-root")?.classList.add("hidden");
|
document.querySelector(".legacy-root")?.classList.add("hidden");
|
||||||
ObserveMenuItemPosition();
|
ObserveMenuItemPosition();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export class StorageChangeHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleIconOnlySidebarChange(newValue: boolean | undefined) {
|
private handleIconOnlySidebarChange(newValue: boolean | undefined) {
|
||||||
|
if (!document.body) return;
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
document.body.classList.add("icon-only-sidebar");
|
document.body.classList.add("icon-only-sidebar");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user