FEATURE: when entering a topic scroll to last visited line marker (#18440)
When a user enters a topic they have already visited they are navigated to that post that is newest for them (post_number_last_read + 1). Above that post there is a "last visited" line marker which is visible when the user scrolls a bit above the post they landed on. This commit makes sure that the "last visited" line marker is visible as soon as user is landed in the topic.
This commit is contained in:
parent
b615201b88
commit
136174e0ee
|
@ -117,6 +117,15 @@ const DiscourseURL = EmberObject.extend({
|
|||
|
||||
if (!holder) {
|
||||
selector = holderId;
|
||||
|
||||
if (
|
||||
document.getElementsByClassName(
|
||||
`topic-post-visited-line post-${postNumber - 1}`
|
||||
)?.length === 1
|
||||
) {
|
||||
selector = ".small-action.topic-post-visited";
|
||||
}
|
||||
|
||||
holder = document.querySelector(selector);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue