mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 11:22:47 +08:00
Add some logic to jumpTop/jumpBottom when best of is enabled
This commit is contained in:
parent
68d849419b
commit
0d83f373b8
|
@ -126,11 +126,19 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
|
|||
},
|
||||
|
||||
jumpTop: function() {
|
||||
Discourse.URL.routeTo(this.get('content.url'));
|
||||
if (this.get('bestOf')) {
|
||||
Discourse.TopicView.scrollTo(this.get('id'), this.get('posts').first().get('post_number'));
|
||||
} else {
|
||||
Discourse.URL.routeTo(this.get('url'));
|
||||
}
|
||||
},
|
||||
|
||||
jumpBottom: function() {
|
||||
Discourse.URL.routeTo(this.get('content.lastPostUrl'));
|
||||
if (this.get('bestOf')) {
|
||||
Discourse.TopicView.scrollTo(this.get('id'), this.get('posts').last().get('post_number'));
|
||||
} else {
|
||||
Discourse.URL.routeTo(this.get('lastPostUrl'));
|
||||
}
|
||||
},
|
||||
|
||||
cancelFilter: function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user