DEV: Remove all direction tracking from sticky-avatars code (#27224)

No longer required since b6cc95a0e1
This commit is contained in:
David Taylor 2024-05-28 13:17:27 +01:00 committed by GitHub
parent 63b7b598cb
commit aea1f4417a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,8 +18,6 @@ export default class StickyAvatars extends Modifier {
element; element;
intersectionObserver; intersectionObserver;
direction = "⬇️";
prevOffset = -1;
constructor() { constructor() {
super(...arguments); super(...arguments);
@ -71,17 +69,10 @@ export default class StickyAvatars extends Modifier {
@bind @bind
_handleScroll(offset) { _handleScroll(offset) {
if (offset <= 0) { if (offset <= 0) {
this.direction = "⬇️";
this.element this.element
.querySelectorAll(`${TOPIC_POST_SELECTOR}.${STICKY_CLASS}`) .querySelectorAll(`${TOPIC_POST_SELECTOR}.${STICKY_CLASS}`)
.forEach((node) => node.classList.remove(STICKY_CLASS)); .forEach((node) => node.classList.remove(STICKY_CLASS));
} else if (offset > this.prevOffset) {
this.direction = "⬇️";
} else {
this.direction = "⬆️";
} }
this.prevOffset = offset;
} }
@bind @bind