Module: delite/focus

delite/focus

Tracks which widgets are currently "active".

A widget is considered active if it or a descendant widget has focus, or if a non-focusable node of this widget or a descendant was recently clicked.

Call focus.on("active-widget-stack", callback) to track the stack of currently focused widgets.

Call focus.on("widget-blur", func) or focus.on("widget-focus", ...) to monitor when when widgets become active/inactive.

Finally, focus.focus(node) will focus a node, suppressing errors if the node doesn't exist.

Show inherited

Members

<static> activeStack

List of currently active widgets (focused widget and its ancestors).

Properties:
Name Type Description
activeStack Array.<Element>
Source:

Methods

<static> focus(node)

Focus the specified node, suppressing errors if they occur.

Parameters:
Name Type Description
node Element
Source:

<static> registerIframe(iframe) → {Object}

Registers listeners on the specified iframe so that any click or focus event on that iframe (or anything in it) is reported as a focus/click event on the <iframe> itself.

In dijit this was only used by editor; perhaps it should be removed.

Parameters:
Name Type Description
iframe HTMLIframeElement
Source:
Returns:

Handle with remove() method to deregister.

Type
Object