core/tree

Description:
  • Implement an accessible aria tree widget, from a nested unordered list. Based on http://oaa-accessibility.org/example/41/.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Implement an accessible aria tree widget, from a nested unordered list. Based on http://oaa-accessibility.org/example/41/.

Methods

(inner) bindEventHandlers()

Description:
  • Bind the event listeners we require.

Source:

(inner) collapseGroup(item)

Description:
  • Collapse an expanded group.

Source:
Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group.

(inner) expandAllChildGroups(item)

Description:
  • Find all child group nodes from the given node and expand them.

Source:
Parameters:
Name Type Description
item Object

is the jquery id of the group.

(inner) expandAllGroups()

Description:
  • Expand all group nodes within the tree.

Source:

(inner) expandGroup(item) → {Object}

Description:
  • Expand a collapsed group.

    Handles expanding nodes that are ajax loaded (marked with a data-requires-ajax attribute).

Source:
Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group.

Returns:

a promise that is resolved when the group has been expanded.

Type
Object

(inner) finishExpandingGroup(item)

Description:
  • Perform the necessary DOM changes to display a group item.

Source:
Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group.

(inner) getVisibleItems() → {Object}

Description:
  • Get all visible tree items.

Source:
Returns:

visible items

Type
Object

(inner) handleClick(event)

Description:
  • Handle a click (select).

Source:
Parameters:
Name Type Description
event Event

The event.

(inner) handleFocus(e)

Description:
  • Handle a focus event.

Source:
Parameters:
Name Type Description
e Event

The event.

(inner) handleKeyDown(e)

Description:
  • Handle a key down event - ie navigate the tree.

Source:
Parameters:
Name Type Description
e Event

The event.

(inner) initialiseNodes(node)

Description:
  • Performs the tree initialisation for all child items from the given node, such as removing everything from the tab order and setting aria selected on items.

Source:
Parameters:
Name Type Description
node object

jquery object representing a node.

(inner) isGroupCollapsed(item) → {bool}

Description:
  • Determines if the given group item (contains child tree items) is collapsed.

Source:
Parameters:
Name Type Description
item object

jquery object representing a group item on the tree.

Returns:
Type
bool

(inner) isGroupCollapsible(item) → {bool}

Description:
  • Determines if the given group item (contains child tree items) can be collapsed.

Source:
Parameters:
Name Type Description
item object

jquery object representing a group item on the tree.

Returns:
Type
bool

(inner) isGroupItem(item) → {bool}

Description:
  • Determines if the given item is a group item (contains child tree items) in the tree.

Source:
Parameters:
Name Type Description
item object

jquery object representing an item on the tree.

Returns:
Type
bool

(inner) isGroupItem(item) → {bool}

Description:
  • Determines if the given item is a group item (contains child tree items) in the tree.

Source:
Parameters:
Name Type Description
item object

jquery object representing an item on the tree.

Returns:
Type
bool

(inner) refreshVisibleItemsCache()

Description:
  • Find all visible tree items and save a cache of them on the tree object.

Source:

(inner) removeAllFromTabOrder(node)

Description:
  • Removes all child DOM elements of the given node from the tab order.

Source:
Parameters:
Name Type Description
node object

jquery object representing a node.

(inner) setActiveItem(item)

Description:
  • Mark the given item as active within the tree and fire the callback for when the active item is set.

Source:
Parameters:
Name Type Description
item object

jquery object representing an item on the tree.

(inner) setAriaSelectedFalseOnItems(node)

Description:
  • Find all child tree items from the given node and set the aria selected attribute to false.

Source:
Parameters:
Name Type Description
node object

jquery object representing a node.

(inner) toggleGroup(item)

Description:
  • Expand or collapse a group.

Source:
Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group.