mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 14:15:36 +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) {
|
||||
const postStream = this.get("model.postStream");
|
||||
let postId = postStream.findPostIdForPostNumber(postNumber);
|
||||
if (this.get("model.postStream.isMegaTopic")) {
|
||||
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 (!postId) {
|
||||
const closest = postStream.closestPostNumberFor(postNumber);
|
||||
postId = postStream.findPostIdForPostNumber(closest);
|
||||
// If we couldn't find the post, find the closest post to it
|
||||
if (!postId) {
|
||||
const closest = postStream.closestPostNumberFor(postNumber);
|
||||
postId = postStream.findPostIdForPostNumber(closest);
|
||||
}
|
||||
|
||||
this._jumpToPostId(postId);
|
||||
}
|
||||
|
||||
this._jumpToPostId(postId);
|
||||
},
|
||||
|
||||
jumpTop() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user