utility.js: replace Utility.scroll_to with Element.scrollIntoView.
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView https://caniuse.com/#feat=scrollintoview
This commit is contained in:
@@ -4,7 +4,5 @@ if ($("#forum_post_body").val().length > 0) {
|
||||
}
|
||||
$("#forum_post_body").val(msg);
|
||||
$("#topic-response").show();
|
||||
$('html, body').animate({
|
||||
scrollTop: $("#forum_post_body").offset().top - 100
|
||||
}, 500);
|
||||
document.body.scrollIntoView(false);
|
||||
$("#forum_post_body").selectEnd();
|
||||
|
||||
@@ -49,11 +49,7 @@
|
||||
$(function() {
|
||||
$("#new-response-link").click(function(e) {
|
||||
$("#topic-response").show();
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $("#forum_post_body").offset().top - 100
|
||||
}, 500);
|
||||
|
||||
document.body.scrollIntoView(false);
|
||||
e.preventDefault();
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user