DEV: Trigger events when filtering replies (#11498)

This commit is contained in:
Penar Musaraj
2020-12-16 00:46:40 -05:00
committed by GitHub
parent c1ba3d786c
commit 89bf64c0bf
@@ -254,6 +254,10 @@ export default RestModel.extend({
filterReplies(postNumber) {
this.cancelFilter();
this.set("filterRepliesToPostNumber", postNumber);
this.appEvents.trigger("post-stream:filter-replies", {
topic_id: this.get("topic.id"),
post_number: postNumber,
});
return this.refresh({ refreshInPlace: true }).then(() => {
const element = document.querySelector(`#post_${postNumber}`);
@@ -280,6 +284,10 @@ export default RestModel.extend({
filterUpwards(postID) {
this.cancelFilter();
this.set("filterUpwardsPostID", postID);
this.appEvents.trigger("post-stream:filter-upwards", {
topic_id: this.get("topic.id"),
post_id: postID,
});
return this.refresh({ refreshInPlace: true }).then(() => {
this.appEvents.trigger("post-stream:refresh");