mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
DEV: sticky avatar was retained during tests (#14969)
This commit is contained in:
parent
ff7e685a59
commit
035822d9e0
@ -5,6 +5,10 @@ export default {
|
||||
after: "inject-objects",
|
||||
|
||||
initialize(container) {
|
||||
StickyAvatars.init(container);
|
||||
this._stickyAvatars = StickyAvatars.init(container);
|
||||
},
|
||||
|
||||
teardown() {
|
||||
this._stickyAvatars?.destroy();
|
||||
},
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ export default class StickyAvatars {
|
||||
prevOffset = -1;
|
||||
|
||||
static init(container) {
|
||||
new this(container).init();
|
||||
return new this(container).init();
|
||||
}
|
||||
|
||||
constructor(container) {
|
||||
@ -29,6 +29,12 @@ export default class StickyAvatars {
|
||||
appEvents.on("page:topic-loaded", this._initIntersectionObserver);
|
||||
|
||||
addWidgetCleanCallback("post-stream", this._clearIntersectionObserver);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.container = null;
|
||||
}
|
||||
|
||||
@bind
|
||||
|
Loading…
Reference in New Issue
Block a user