mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 08:23:43 +08:00
fe3d82a44a
Given we are a single-page-app, we hijack the browser's default behavior for keyboard shortcuts like End because on long topics (20+ posts) we need to load the last post before really reaching the end of the page. However, when the last post is already rendered, the End shortcut currently does nothing, it takes the user to the start of the last post. If that post is too long, the user will have to scroll down manually. This change ensures that if the last post of a topic is already rendered (whether it is in the viewport or not), pressing End will take the user to the very bottom of the page. Note for the reviewer: the test added here is for the general case, it is too hard to test the case where the last post is already rendered, that isn't covered here. |
||
---|---|---|
.. | ||
fabricators | ||
fixtures | ||
generator | ||
helpers | ||
import_export | ||
initializers | ||
integration | ||
integrity | ||
jobs | ||
lib | ||
mailers | ||
migrations | ||
models | ||
multisite | ||
requests | ||
script/import_scripts | ||
serializers | ||
services | ||
support | ||
system | ||
tasks | ||
views | ||
rails_helper.rb | ||
regenerate_swagger_docs | ||
swagger_helper.rb |