mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 05:35:52 +08:00
FIX: jumpToPost
no working on megatopics.
This commit is contained in:
parent
9647a0a4bc
commit
b459a589ab
@ -588,16 +588,20 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
jumpToPost(postNumber) {
|
jumpToPost(postNumber) {
|
||||||
const postStream = this.get("model.postStream");
|
if (this.get("model.postStream.isMegaTopic")) {
|
||||||
let postId = postStream.findPostIdForPostNumber(postNumber);
|
this._jumpToPostNumber(postNumber);
|
||||||
|
} else {
|
||||||
|
const postStream = this.get("model.postStream");
|
||||||
|
let postId = postStream.findPostIdForPostNumber(postNumber);
|
||||||
|
|
||||||
// If we couldn't find the post, find the closest post to it
|
// If we couldn't find the post, find the closest post to it
|
||||||
if (!postId) {
|
if (!postId) {
|
||||||
const closest = postStream.closestPostNumberFor(postNumber);
|
const closest = postStream.closestPostNumberFor(postNumber);
|
||||||
postId = postStream.findPostIdForPostNumber(closest);
|
postId = postStream.findPostIdForPostNumber(closest);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._jumpToPostId(postId);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._jumpToPostId(postId);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpTop() {
|
jumpTop() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user