#48 Several optimizations for font color enhancements
This commit is contained in:
parent
96000452cf
commit
ac26b2b330
|
@ -54,8 +54,7 @@ function tryRegisterObserverForBadge(badge: Node): void {
|
||||||
mutations.forEach(mutation => {
|
mutations.forEach(mutation => {
|
||||||
// prevent recursive calls when our class is added / removed
|
// prevent recursive calls when our class is added / removed
|
||||||
if (mutation.target instanceof Element) {
|
if (mutation.target instanceof Element) {
|
||||||
// TODO: Validate if that still works
|
if ((mutation.oldValue?.indexOf(DARKCOLOR_CLASS) >= 0 ?? false) !== (mutation.target?.classList?.contains(DARKCOLOR_CLASS) ?? false)) {
|
||||||
if ((mutation.oldValue?.indexOf(DARKCOLOR_CLASS) ?? -1 ^ (mutation.target?.classList?.contains(DARKCOLOR_CLASS) ?? false ? 0 : -1)) === 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue