TabbingManager

Drupal~ TabbingManager

new TabbingManager()

Source:
Provides an API for managing page tabbing order modifications.

Methods

activate(tabbingContext)

Source:
Makes all elements outside of the tabbingContext's set untabbable. Elements made untabbable have their original tabindex and autofocus values stored so that they might be restored later when this tabbingContext is deactivated.
Parameters:
Name Type Description
tabbingContext Drupal~TabbingContext The TabbingContext instance that has been activated.

constrain(elements, optionsopt) → {Drupal~TabbingContext}

Source:
Constrain tabbing to the specified set of elements only. Makes elements outside of the specified set of elements unreachable via the tab key.
Parameters:
Name Type Attributes Default Description
elements jQuery | Selector | Element | ElementArray | object | selection The set of elements to which tabbing should be constrained. Can also be any jQuery-compatible argument.
options object <optional>
{} Constrain options.
Properties
Name Type Attributes Default Description
trapFocus boolean <optional>
false When true, tabbing is trapped within the set of elements and can't leave the browser. If the final element in the set is tabbed, the first element in the set will receive focus. If the first element in the set is shift-tabbed, the last element in the set will receive focus. When false, it is possible to tab out of the browser window by tabbing the final element in the set or shift-tabbing the first element in the set.
Fires:
Returns:
The TabbingContext instance.
Type
Drupal~TabbingContext

deactivate(tabbingContext)

Source:
Restores that tabbable state of a tabbingContext's disabled elements. Elements that were made untabbable have their original tabindex and autofocus values restored.
Parameters:
Name Type Description
tabbingContext Drupal~TabbingContext The TabbingContext instance that has been deactivated.

recordTabindex($el, level)

Source:
Records the tabindex and autofocus values of an untabbable element.
Parameters:
Name Type Description
$el jQuery The set of elements that have been disabled.
level number The stack level for which the tabindex attribute should be recorded.

release()

Source:
Restores a former tabbingContext when an active one is released. The TabbingManager stack of tabbingContext instances will be unwound from the top-most released tabbingContext down to the first non-released tabbingContext instance. This non-released instance is then activated.

restoreTabindex($el, level)

Source:
Restores the tabindex and autofocus values of a reactivated element.
Parameters:
Name Type Description
$el jQuery The element that is being reactivated.
level number The stack level for which the tabindex attribute should be restored.