Fix mobile topic-timeline not closing on scrolling past last post (#8730)
* when we dragged the topic-timeline handle past the last post in a topic we were not closing the timeline as we would if scrolling to a specific post * this also fixes the issue where when scrolling past the end of the topic with a massive last post, none of the post could be seen
This commit is contained in:
parent
7c32411881
commit
18bba860b5
|
@ -727,6 +727,10 @@ export default Controller.extend(bufferedProperty("model"), {
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpEnd() {
|
jumpEnd() {
|
||||||
|
this.appEvents.trigger(
|
||||||
|
"topic:jump-to-post",
|
||||||
|
this.get("model.highest_post_number")
|
||||||
|
);
|
||||||
DiscourseURL.routeTo(this.get("model.lastPostUrl"), {
|
DiscourseURL.routeTo(this.get("model.lastPostUrl"), {
|
||||||
jumpEnd: true
|
jumpEnd: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -103,11 +103,14 @@ const DiscourseURL = EmberObject.extend({
|
||||||
let holderHeight = $holder.height();
|
let holderHeight = $holder.height();
|
||||||
let windowHeight = $(window).height() - offsetCalculator();
|
let windowHeight = $(window).height() - offsetCalculator();
|
||||||
|
|
||||||
// scroll to the bottom of the post and stop any further action if the
|
// scroll to the bottom of the post and if the post is yuge we go back up the
|
||||||
// post is yuge, otherwise just jump to the top of the post
|
// timeline by a small % of the post height so we can see the bottom of the text.
|
||||||
// using the lock & holder method
|
//
|
||||||
|
// otherwise just jump to the top of the post using the lock & holder method.
|
||||||
if (holderHeight > windowHeight) {
|
if (holderHeight > windowHeight) {
|
||||||
$(window).scrollTop($holder.offset().top + holderHeight);
|
$(window).scrollTop(
|
||||||
|
$holder.offset().top + (holderHeight - holderHeight / 10)
|
||||||
|
);
|
||||||
_transitioning = false;
|
_transitioning = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue