-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll to Top of Topic instead of Reloading #2050
Conversation
You've signed the CLA, verg. Thank you! This pull request is ready for review. |
This means copying the link from the topic header is now deep linking to the first post -- that's not desirable. Cases 2 and 3 in your list are probably OK though since they aren't such obvious click-copy targets. |
|
||
jumpToTopPost: function () { | ||
var topic = this.get('topic'); | ||
if (topic) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not call the jumpTop method in the file below this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it normal to call functions on other controllers? That feels odd to me.
@coding-horror Do you think something like this would work?
Enter the Topic url in the href, but link to an action that loads the first post. I just tested it out in my dev and it works functionally. |
provided right-click copy of the URL in the topic header returns the root URL, with no /1 on it, that should be OK. We usually test in Safari, IE10+, FF, Chrome. |
@verg yes that is far preferable we can not give up right click, also ... please test cases where posts are not loaded (eg: very long topic) |
Great. Thanks! I updated the PR so the title links have the topic-level href. Looks good on Safari/IE/FF/Chrome and on long topics. |
OK, trying this out! thanks! |
Scroll to Top of Topic instead of Reloading
This PR changes the following links to use URLs with the first post rather than the topic url:
For example. We'll now link to
/t/discourse-general-polish/13184/1/
instead of than/t/discourse-general-polish/13184
. This loads the topic much more quickly than the full page reload.From: https://meta.discourse.org/t/discourse-general-polish/13184