FIX: Don't reload a topic when clicking the first post search result
This commit is contained in:
parent
0ff25a379c
commit
951d6ac28f
|
@ -50,6 +50,12 @@ const Post = RestModel.extend({
|
||||||
return Discourse.Utilities.postUrl(this.get('topic.slug') || this.get('topic_slug'), this.get('topic_id'), this.get('post_number'));
|
return Discourse.Utilities.postUrl(this.get('topic.slug') || this.get('topic_slug'), this.get('topic_id'), this.get('post_number'));
|
||||||
}.property('post_number', 'topic_id', 'topic.slug'),
|
}.property('post_number', 'topic_id', 'topic.slug'),
|
||||||
|
|
||||||
|
// Don't drop the /1
|
||||||
|
urlWithNumber: function() {
|
||||||
|
const url = this.get('url');
|
||||||
|
return (this.get('post_number') === 1) ? url + "/1" : url;
|
||||||
|
}.property('post_number', 'url'),
|
||||||
|
|
||||||
usernameUrl: Discourse.computed.url('username', '/users/%@'),
|
usernameUrl: Discourse.computed.url('username', '/users/%@'),
|
||||||
|
|
||||||
showUserReplyTab: function() {
|
showUserReplyTab: function() {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{{#each results as |result|}}
|
{{#each results as |result|}}
|
||||||
<a class='search-link' href='{{unbound result.url}}'>
|
{{log result}}
|
||||||
|
<a class='search-link' href='{{unbound result.urlWithNumber}}'>
|
||||||
<span class='topic'>
|
<span class='topic'>
|
||||||
{{i18n 'search.post_format' post_number=result.post_number username=result.username}}
|
{{i18n 'search.post_format' post_number=result.post_number username=result.username}}
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in New Issue