diff --git a/assets/js/app.js b/assets/js/app.js index d48e53d..b1c4b9c 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -275,14 +275,18 @@ if (item) switch_status(item.getAttribute("data-item-id")); } - function scroll_page_to(item) { + + function scroll_page_to(item) + { var clientHeight = pageYOffset + document.documentElement.clientHeight; var itemPosition = item.offsetTop + item.offsetHeight; + if (clientHeight - itemPosition < 0 || clientHeight - item.offsetTop > document.documentElement.clientHeight) { - scrollTo(0, item.offsetTop - 10); + window.scrollTo(0, item.offsetTop - 10); } } + function set_links_item(item_id) { var link = document.getElementById("current-item");