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:
evazion
2018-08-16 22:03:50 -05:00
parent ad056e69d5
commit dfffabd662
5 changed files with 4 additions and 28 deletions

View File

@@ -12,24 +12,6 @@ Utility.test_max_width = function(width) {
return mq.matches;
}
Utility.scrolling = false;
Utility.scroll_to = function(element) {
if (Utility.scrolling) {
return;
} else {
Utility.scrolling = true;
}
var top = null;
if (typeof element === "number") {
top = element;
} else {
top = element.offset().top - 10;
}
$('html, body').animate({scrollTop: top}, 300, "linear", function() {Utility.scrolling = false;});
}
Utility.notice_timeout_id = undefined;
Utility.notice = function(msg, permanent) {