()
| 8 | }; |
| 9 | |
| 10 | const scrollToMark = () => { |
| 11 | let top = localStorage.getItem('bookmark' + location.pathname); |
| 12 | top = parseInt(top, 10); |
| 13 | // If the page opens with a specific hash, just jump out |
| 14 | if (!isNaN(top) && location.hash === '') { |
| 15 | // Auto scroll to the position |
| 16 | window.anime({ |
| 17 | targets : document.scrollingElement, |
| 18 | duration : 200, |
| 19 | easing : 'linear', |
| 20 | scrollTop: top |
| 21 | }); |
| 22 | } |
| 23 | }; |
| 24 | // Register everything |
| 25 | const init = function(trigger) { |
| 26 | // Create a link element |