Skip to content

A platform for community discussion. Free, open, simple.

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

David Tayloraea1f4417a40
diff --git a/app/assets/javascripts/discourse/app/modifiers/sticky-avatars.js b/app/assets/javascripts/discourse/app/modifiers/sticky-avatars.js
index 6c3ec4bdef2..9d6952dcabd 100644
--- a/app/assets/javascripts/discourse/app/modifiers/sticky-avatars.js
+++ b/app/assets/javascripts/discourse/app/modifiers/sticky-avatars.js
@@ -18,8 +18,6 @@ export default class StickyAvatars extends Modifier {
element;
intersectionObserver;
- direction = "⬇️";
- prevOffset = -1;
constructor() {
super(...arguments);
@@ -71,17 +69,10 @@ export default class StickyAvatars extends Modifier {
@bind
_handleScroll(offset) {
if (offset <= 0) {
- this.direction = "⬇️";
this.element
.querySelectorAll(`${TOPIC_POST_SELECTOR}.${STICKY_CLASS}`)
.forEach((node) => node.classList.remove(STICKY_CLASS));
- } else if (offset > this.prevOffset) {
- this.direction = "⬇️";
- } else {
- this.direction = "⬆️";
}
-
- this.prevOffset = offset;
}
@bind