(el, offset = 0)
| 11 | let coverHeight = 0; |
| 12 | |
| 13 | function scrollTo(el, offset = 0) { |
| 14 | if (scroller) { |
| 15 | scroller.stop(); |
| 16 | } |
| 17 | |
| 18 | enableScrollEvent = false; |
| 19 | scroller = new Tweezer({ |
| 20 | start: window.pageYOffset, |
| 21 | end: |
| 22 | Math.round(el.getBoundingClientRect().top) + window.pageYOffset - offset, |
| 23 | duration: 500, |
| 24 | }) |
| 25 | .on('tick', v => window.scrollTo(0, v)) |
| 26 | .on('done', () => { |
| 27 | enableScrollEvent = true; |
| 28 | scroller = null; |
| 29 | }) |
| 30 | .begin(); |
| 31 | } |
| 32 | |
| 33 | function highlight(path) { |
| 34 | if (!enableScrollEvent) { |
no outgoing calls
no test coverage detected
searching dependent graphs…