* Scroll to the element with id extracted from the current location hash fragment. * Scroll to top if no hash. * Don't scroll if hash not found.
()
| 81 | * Don't scroll if hash not found. |
| 82 | */ |
| 83 | scroll() { |
| 84 | const hash = this.getCurrentHash(); |
| 85 | const element: HTMLElement = hash |
| 86 | ? this.document.getElementById(hash) |
| 87 | : this.topOfPageElement; |
| 88 | this.scrollToElement(element); |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * test if the current location has a hash |
no test coverage detected