new FocusManager()

Description

A utility class that aides with computational focus.

Details

Namespaces


Utilities

Members


<private> _sections :?NodeListOf.<HTMLElement>|Object

Description

This object will store all top-level sections of the site for easy access.

Details
?NodeListOf.<HTMLElement> | Object

sections

Description

Return all pre-defined sections of importance.

Returns
Details

Methods


addSection( key, element )

Description

Add a section. This should only be used when an important section gets programmatically added to the DOM. Otherwise you should probably do it through the data attributes.

Parameters
Name Type Description
key string
element HTMLElement
Details

removeSection( key )

Description

Remove a section. This means that this section will no longer be accessible through the key format. This could potentially lead to buggy focus-behaviour and should only be used if the given section gets removed from the DOM, or changes hierarchically so it isn't as important anymore.

Parameters
Name Type Description
key string
Details

rejectFocusToAllSections()

Description

Reject focus from all important sections. Useful if you want to give focus to one particular section, e.g a dialog.

Details

rejectFocusToSection( key )

Description

Reject focus from a section in particular.

Parameters
Name Type Description
key string
Details

allowFocusToSection( key )

Description

Allow focus to a specific section.

Parameters
Name Type Description
key string
Details