Module: @aofl/component-utils

Exports findParent, isInViewport, and IsInViewportMixin
Version:
  • 1.0.0
Author:
Source:

Classes

IsInViewportMixinClass

Methods


<static> findParent(node, args)

Finds parent method with matching signature
Parameters:
Name Type Argument Description
node HTMLElement
args * <repeatable>
Source:
Returns:
Type
Object

<static> findParentByAttributes(node, args)

Finds parent method with matching attributes
Parameters:
Name Type Argument Description
node HTMLElement
args * <repeatable>
Source:
Returns:
Type
Object

<static> isInViewport(node, widthThreshold, heightThreshold)

isInViewPort() check whether or not the supplied element is within the visible area of the screen. The threshold values are multipliers of their respective dimension. 0 means the exact viewport dimensions and .5 means viewport + half of viewport.
Parameters:
Name Type Default Description
node HTMLElement
widthThreshold Number 0
heightThreshold Number 0
Source:
Returns:
Type
Boolean

<static> isInViewportMixin(superClass)

Mixes the superClass with functions necessary to detect if the element is within the visible area of the page.
Parameters:
Name Type Description
superClass LitElement
Source:

<static> traverseParents(node, cb)

Finds parent based on the validity of the `cb` function
Parameters:
Name Type Description
node HTMLElement
cb function
Source:
Returns:
Returns a HTMLElement matching the pattern defined in cb or false.
Type
HTMLElement | Boolean