htz-collapsibles/evaluate

Module: htz-collapsibles/evaluate

(require("htz-collapsibles/evaluate"))(element, contentElem, toggleElem, labelExpand, labelCollapse, collapsedClass, expandedClass, bpsSelector, isExpandedopt) → {Boolean}

Evaluate a collapsible element and set its state to the correct one in current conditions.

Parameters
Name Type Attributes Description
element HTMLElement

An element to evaluate.

contentElem HTMLElement

The element containing the collapsible content.

toggleElem HTMLElement

The clickable element used for toggling.

labelExpand String

The label used to describe the toggle button when the element is collapsed and the button is used for expanding.

labelCollapse String

The label used to describe the toggle button when the element is expanded and the button is used for collapsing.

collapsedClass String

The label to attach to the wrapper when it is collapsed.

expandedClass String

The label to attach to the wrapper when it is expanded.

bpsSelector String

A selector for the element to which the active breakpoint data is attached. See htz-parse-bps-state

isExpanded Boolean <optional>

Indicates if the collapsible is collapsed (false) or expanded (true`).

Returns
  • The evaluated element's state - false if collapsed, true if expanded.
Type
Boolean