The NodeFocusManager class is a plugin for a Node instance. The class is used
via the plug method of Node
and should not be instantiated directly.
_afterActiveDescendantChangeevent
afterChange event handler for the "activeDescendant" attribute.
event
Object
Object representing the change event.
_attachKeyHandlerAttaches the "key" event handlers used to support the "keys" attribute.
_detachEventHandlersAttaches all event handlers used by the Focus Manager.
_detachEventHandlersDetaches all event handlers used by the Focus Manager.
_detachKeyHandlerDetaches the "key" event handlers used to support the "keys" attribute.
_fireClickFires the click event if the enter key is pressed while focused on an HTML element that is not natively clickable.
_focusNextevent
activeDescendant
Keydown event handler that moves focus to the next enabled descendant.
_focusPreviousevent
activeDescendant
Keydown event handler that moves focus to the previous enabled descendant.
_initDescendantsSets the tabIndex attribute of all of the
descendants to -1, except the active descendant, whose
tabIndex attribute is set to 0.
_isDescendantnode
Determines if the specified Node instance is a descendant managed by the Focus Manager.
node
Node
Node instance to be checked.
Boolean indicating if the specified Node instance is a descendant managed by the Focus Manager.
_onDocFocusevent
"focus" event handler for the owner document of the Focus Manager's Node.
event
Object
Object representing the DOM event.
_onDocMouseDownevent
"mousedown" event handler for the owner document of the Focus Manager's Node.
event
Object
Object representing the DOM event.
_preventScrollPrevents the viewport from scolling when the user presses the up, down, left, or right key.
_removeFocusClassRemoves the class name representing focus (as specified by the "focusClass" attribute) from the Node instance to which it is currently applied.
blurBlurs the current active descendant and sets the
focused attribute to false.
focusindex
Focuses the active descendant and sets the
focused attribute to true.
refreshRefreshes the Focus Manager's descendants by re-executing the
CSS selector query specified by the descendants attribute.
startEnables the Focus Manager.
stopDisables the Focus Manager by detaching all event handlers.
activeDescendantNode, or index of the Node, representing the descendant that is either
focused or is focusable (tabIndex attribute is set to 0).
The value cannot represent a disabled descendant Node. Use a value of -1
to remove all descendant Nodes from the default tab flow.
If no value is specified, the active descendant will be inferred using
the following criteria:
tabIndex attribute of each descendant and
using the first descendant whose tabIndex attribute is set
to 0activeDescendantChange
Fires when the value for the configuration attribute activeDescendant is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
circularBoolean indicating if focus should be set to the first/last descendant when the end or beginning of the descendants has been reached.
Default: true
circularChange
Fires when the value for the configuration attribute circular is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
descendantsString representing the CSS selector used to define the descendant Nodes whose focus should be managed.
descendantsChange
Fires when the value for the configuration attribute descendants is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
focusClassString representing the name of class applied to the focused active
descendant Node. Can also be an object literal used to define both the
class name, and the Node to which the class should be applied. If using
an object literal, the format is:
{ className: "focus", fn: myFunction }. The function
referenced by the fn property in the object literal will be
passed a reference to the currently focused active descendant Node.
focusClassChange
Fires when the value for the configuration attribute focusClass is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
focusedBoolean indicating that one of the descendants is focused.
Default: false
focusedChange
Fires when the value for the configuration attribute focused is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
keysObject literal representing the keys to be used to navigate between the
next/previous descendant. The format for the attribute's value is
{ next: "down:40", previous: "down:38" }. The value for the
"next" and "previous" properties are used to attach
key event listeners. See
the Using the key Event section of
the Event documentation for more information on "key" event listeners.
keysChange
Fires when the value for the configuration attribute keys is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade