mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
perf: remove document color change observer
This commit is contained in:
@@ -698,12 +698,9 @@ export function tryLoad() {
|
||||
'load',
|
||||
function () {
|
||||
removeThemeTagsFromNotices()
|
||||
documentTextColor()
|
||||
},
|
||||
true,
|
||||
)
|
||||
const observer = new MutationObserver(() => { documentTextColor() })
|
||||
observer.observe(document!, { attributes: true, childList: true, subtree: true, attributeFilter: ['td'], })
|
||||
}
|
||||
|
||||
function ChangeMenuItemPositions(storage: any) {
|
||||
@@ -2491,33 +2488,3 @@ async function CheckForMenuList() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function documentTextColor() {
|
||||
if (settingsState.DarkMode) {
|
||||
const documentArray = document.querySelectorAll('td:not([class^="colourBar"]):not([class^="title"])')
|
||||
const fullDocArray = document.querySelectorAll('tr.document')
|
||||
const linkArray = document.querySelectorAll('a.uiFile')
|
||||
for (const item of fullDocArray) {
|
||||
item.classList.add('documentDark')
|
||||
}
|
||||
for (const item of linkArray) {
|
||||
item.setAttribute('style', 'color: #06b4fc;')
|
||||
}
|
||||
for (const item of documentArray) {
|
||||
item.setAttribute('style', 'color: white')
|
||||
}
|
||||
} else {
|
||||
const documentArray = document.querySelectorAll('td:not([class^="colourBar"]):not([class^="title"])')
|
||||
const fullDocArray = document.querySelectorAll('tr.document')
|
||||
const linkArray = document.querySelectorAll('a.uiFile')
|
||||
for (const item of fullDocArray) {
|
||||
item.classList.remove('documentDark')
|
||||
}
|
||||
for (const item of linkArray) {
|
||||
item.setAttribute('style', 'color: #3465a4;')
|
||||
}
|
||||
for (const item of documentArray) {
|
||||
item.setAttribute('style', 'color: black')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1672,6 +1672,17 @@ div.entry.class[style*="width: 46.5%"] {
|
||||
margin-top: 4px !important;
|
||||
}
|
||||
|
||||
.dark .title a.uiFile {
|
||||
color: #06b4fc !important;
|
||||
}
|
||||
|
||||
.document td:not([class^="colourBar"]):not([class^="title"]) {
|
||||
color: black;
|
||||
}
|
||||
.dark .document td:not([class^="colourBar"]):not([class^="title"]) {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.uiFileHandlerPanel::before {
|
||||
border: 12px solid rgba(0, 0, 0, 0);
|
||||
border-top-color: var(--background-primary);
|
||||
|
||||
Reference in New Issue
Block a user