forum posts: fix the "post reply" link scrolling to top of page.
Fix regression in 6fbca01a2.
Also make it so the "reply" link automatically inserts the cursor into
the reply box. Do this for both forum posts and comments. Before it only
did this when quoting a post, not when creating a new post.
This commit is contained in:
@@ -16,6 +16,7 @@ class CommentComponent {
|
||||
var $form = $(e.target).closest("div.new-comment").find("form");
|
||||
$form.show();
|
||||
$form[0].scrollIntoView(false);
|
||||
$form.find("textarea").selectEnd();
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ class ForumPostComponent {
|
||||
|
||||
static showNewForumPostForm(e) {
|
||||
$("#topic-response").show();
|
||||
document.body.scrollIntoView(false);
|
||||
$("#forum_post_body").get(0).scrollIntoView(false);
|
||||
$("#forum_post_body").selectEnd();
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,5 @@ if ($("#forum_post_body").val().length > 0) {
|
||||
}
|
||||
$("#forum_post_body").val(msg);
|
||||
$("#topic-response").show();
|
||||
document.body.scrollIntoView(false);
|
||||
$("#forum_post_body").get(0).scrollIntoView(false);
|
||||
$("#forum_post_body").selectEnd();
|
||||
|
||||
Reference in New Issue
Block a user