(x)
| 708 | * @param {number} x The scroll position. |
| 709 | */ |
| 710 | export async function scrollViewportHorizontally(x) { |
| 711 | const isWindow = hot().view._wt.wtOverlays.scrollableElement === hot().rootWindow; |
| 712 | const scrollableElement = isWindow ? window : getMaster().find('.wtHolder')[0]; |
| 713 | |
| 714 | return new Promise((resolve) => { |
| 715 | const scrollHandler = () => { |
| 716 | scrollableElement.removeEventListener('scroll', scrollHandler); |
| 717 | resolve(); |
| 718 | }; |
| 719 | |
| 720 | scrollableElement.addEventListener('scroll', scrollHandler); |
| 721 | x = hot().isRtl() ? -x : x; |
| 722 | |
| 723 | if (isWindow) { |
| 724 | scrollableElement.scrollTo(x, scrollableElement.scrollY); |
| 725 | } else { |
| 726 | scrollableElement.scrollLeft = x; |
| 727 | } |
| 728 | }); |
| 729 | } |
| 730 | |
| 731 | /** |
| 732 | * Moves the browser's viewport to the specified x and y scroll position. |
nothing calls this directly
no test coverage detected
searching dependent graphs…