MCPcopy
hub / github.com/reisxd/TizenTube / scrollingController

Function scrollingController

mods/spatial-navigation-polyfill.js:276–290  ·  view source on GitHub ↗

* Directionally scroll the scrollable spatial navigation container if it can be manually scrolled more. * @function scrollingController * @param container {Node} - The spatial navigation container which can scroll * @param dir {SpatialNavigationDirection} - The directional information for t

(container, dir)

Source from the content-addressed store, hash-verified

274 * @returns {boolean}
275 */
276 function scrollingController(container, dir) {
277
278 // If there is any scrollable area among parent elements and it can be manually scrolled, scroll the document
279 if (isScrollable(container, dir) && !isScrollBoundary(container, dir)) {
280 moveScroll(container, dir);
281 return true;
282 }
283
284 // If the spatnav container is document and it can be scrolled, scroll the document
285 if (!container.parentElement && !isHTMLScrollBoundary(container, dir)) {
286 moveScroll(container.ownerDocument.documentElement, dir);
287 return true;
288 }
289 return false;
290 }
291
292 /**
293 * Find the candidates within a spatial navigation container include delegable container.

Callers 2

navigateFunction · 0.85
navigateChainFunction · 0.85

Calls 4

isScrollableFunction · 0.85
isScrollBoundaryFunction · 0.85
moveScrollFunction · 0.85
isHTMLScrollBoundaryFunction · 0.85

Tested by

no test coverage detected