X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9fe158b78aad887657e9f02f217582bb03f6e406..refs/pull/358/head:/resources/assets/js/global.js diff --git a/resources/assets/js/global.js b/resources/assets/js/global.js index 94462ed64..650919f85 100644 --- a/resources/assets/js/global.js +++ b/resources/assets/js/global.js @@ -61,10 +61,9 @@ Controllers(ngApp, window.Events); // Smooth scrolling jQuery.fn.smoothScrollTo = function () { if (this.length === 0) return; - let scrollElem = document.documentElement.scrollTop === 0 ? document.body : document.documentElement; - $(scrollElem).animate({ + $('html, body').animate({ scrollTop: this.offset().top - 60 // Adjust to change final scroll position top margin - }, 800); // Adjust to change animations speed (ms) + }, 300); // Adjust to change animations speed (ms) return this; };