FIX: prevents expand post to trigger page routing (#8982)
This commit is contained in:
parent
e8efdd60d4
commit
d827430ea6
|
@ -16,19 +16,21 @@ export default Component.extend({
|
||||||
if (this.expanded) {
|
if (this.expanded) {
|
||||||
this.set("expanded", false);
|
this.set("expanded", false);
|
||||||
item.set("expandedExcerpt", null);
|
item.set("expandedExcerpt", null);
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const topicId = item.get("topic_id");
|
const topicId = item.get("topic_id");
|
||||||
const postNumber = item.get("post_number");
|
const postNumber = item.get("post_number");
|
||||||
|
|
||||||
this._loading = true;
|
this._loading = true;
|
||||||
return ajax(`/posts/by_number/${topicId}/${postNumber}.json`)
|
ajax(`/posts/by_number/${topicId}/${postNumber}.json`)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
this.set("expanded", true);
|
this.set("expanded", true);
|
||||||
item.set("expandedExcerpt", result.cooked);
|
item.set("expandedExcerpt", result.cooked);
|
||||||
})
|
})
|
||||||
.finally(() => (this._loading = false));
|
.finally(() => (this._loading = false));
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue