DEV: More events for filtered replies (#11511)
This commit is contained in:
parent
d1058f4e4c
commit
230fe0427e
|
@ -251,12 +251,13 @@ export default RestModel.extend({
|
||||||
return this.refreshAndJumptoSecondVisible();
|
return this.refreshAndJumptoSecondVisible();
|
||||||
},
|
},
|
||||||
|
|
||||||
filterReplies(postNumber) {
|
filterReplies(postNumber, postId) {
|
||||||
this.cancelFilter();
|
this.cancelFilter();
|
||||||
this.set("filterRepliesToPostNumber", postNumber);
|
this.set("filterRepliesToPostNumber", postNumber);
|
||||||
this.appEvents.trigger("post-stream:filter-replies", {
|
this.appEvents.trigger("post-stream:filter-replies", {
|
||||||
topic_id: this.get("topic.id"),
|
topic_id: this.get("topic.id"),
|
||||||
post_number: postNumber,
|
post_number: postNumber,
|
||||||
|
post_id: postId,
|
||||||
});
|
});
|
||||||
return this.refresh({ refreshInPlace: true }).then(() => {
|
return this.refresh({ refreshInPlace: true }).then(() => {
|
||||||
const element = document.querySelector(`#post_${postNumber}`);
|
const element = document.querySelector(`#post_${postNumber}`);
|
||||||
|
|
|
@ -29,6 +29,9 @@ export default createWidget("post-gap", {
|
||||||
args
|
args
|
||||||
).then(() => {
|
).then(() => {
|
||||||
state.loading = false;
|
state.loading = false;
|
||||||
|
this.appEvents.trigger("post-stream:gap-expanded", {
|
||||||
|
post_id: this.model.id,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -175,6 +175,10 @@ createWidget("filter-show-all", {
|
||||||
|
|
||||||
click() {
|
click() {
|
||||||
this.sendWidgetAction("cancelFilter", this.attrs.streamFilters);
|
this.sendWidgetAction("cancelFilter", this.attrs.streamFilters);
|
||||||
|
this.appEvents.trigger(
|
||||||
|
"post-stream:filter-show-all",
|
||||||
|
this.attrs.streamFilters
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ createWidget("post-contents", {
|
||||||
const controller = this.register.lookup("controller:topic");
|
const controller = this.register.lookup("controller:topic");
|
||||||
post
|
post
|
||||||
.get("topic.postStream")
|
.get("topic.postStream")
|
||||||
.filterReplies(this.attrs.post_number)
|
.filterReplies(post.post_number, post.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
controller.updateQueryParams();
|
controller.updateQueryParams();
|
||||||
});
|
});
|
||||||
|
|
|
@ -320,7 +320,7 @@ module("Unit | Model | post-stream", function () {
|
||||||
"by default no replies are filtered"
|
"by default no replies are filtered"
|
||||||
);
|
);
|
||||||
|
|
||||||
postStream.filterReplies(3);
|
postStream.filterReplies(3, 2);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
postStream.get("filterRepliesToPostNumber"),
|
postStream.get("filterRepliesToPostNumber"),
|
||||||
3,
|
3,
|
||||||
|
|
Loading…
Reference in New Issue