(element: HTMLElement)
| 17 | } |
| 18 | |
| 19 | function getContentHeight(element: HTMLElement) { |
| 20 | if (isOnServer) { |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | if (element === document.body) { |
| 25 | // jQuery approach |
| 26 | // whichever is greatest |
| 27 | return Math.max( |
| 28 | document.body.scrollHeight, |
| 29 | document.documentElement.scrollHeight, |
| 30 | document.body.offsetHeight, |
| 31 | document.documentElement.offsetHeight, |
| 32 | document.documentElement.clientHeight |
| 33 | ); |
| 34 | } else { |
| 35 | return element.scrollHeight; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | function scrollTop(element: HTMLElement) { |
| 40 | if (isOnServer) { |
no outgoing calls
no test coverage detected