dijit/_base/focus (version 1.10)

Summary

Deprecated module to monitor currently focused node and stack of currently focused widgets. New code should access dijit/focus directly.

See the dijit/_base/focus reference documentation for more information.

Property Summary

  • _activeStackList of currently active widgets (focused widget and it's ancestors)
  • _curFocusCurrently focused item on screen
  • _prevFocusPreviously focused item on screen

Method Summary

  • getBookmark() Retrieves a bookmark that can be used with moveToBookmark to return to the same range
  • getFocus(menu,openedForWindow) Called as getFocus(), this returns an Object showing the current focus and selected text.
  • isCollapsed() Returns true if there is no text selected
  • moveToBookmark(bookmark) Moves current selection to a bookmark
  • registerIframe(iframe) 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.
  • registerWin(targetWindow,effectiveNode) Registers listeners on the specified window (either the main window or an iframe's window) to detect when the user has clicked somewhere or focused somewhere.
  • unregisterIframe(handle) Unregisters listeners on the specified iframe created by registerIframe.
  • unregisterWin(handle) Unregisters listeners on the specified window (either the main window or an iframe's window) according to handle returned from registerWin().

Properties

_activeStack
Defined by: dijit/_base/focus

List of currently active widgets (focused widget and it's ancestors)

_curFocus
Defined by: dijit/_base/focus

Currently focused item on screen

_prevFocus
Defined by: dijit/_base/focus

Previously focused item on screen

Methods

getBookmark()
Defined by dijit/_base/focus

Retrieves a bookmark that can be used with moveToBookmark to return to the same range

Returns:undefined
getFocus(menu,openedForWindow)
Defined by dijit/_base/focus

Called as getFocus(), this returns an Object showing the current focus and selected text.

Called as getFocus(widget), where widget is a (widget representing) a button that was just pressed, it returns where focus was before that button was pressed. (Pressing the button may have either shifted focus to the button, or removed focus altogether.) In this case the selected text is not returned, since it can't be accurately determined.

Parameter Type Description
menu Widget
Optional

The button that was just pressed. If focus has disappeared or moved to this button, returns the previous focus. In this case the bookmark information is already lost, and null is returned.

openedForWindow Window
Optional

iframe in which menu was opened

Returns:any | object

A handle to restore focus/selection, to be passed to dijit.focus

isCollapsed()
Defined by dijit/_base/focus

Returns true if there is no text selected

Returns:undefined
moveToBookmark(bookmark)
Defined by dijit/_base/focus

Moves current selection to a bookmark

Parameter Type Description
bookmark Object

This should be a returned object from dijit.getBookmark()

Returns:undefined
registerIframe(iframe)
Defined by dijit/_base/focus

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.

Currently only used by editor.

Parameter Type Description
iframe DomNode
Returns:any | undefined

Handle to pass to unregisterIframe()

registerWin(targetWindow,effectiveNode)
Defined by dijit/_base/focus

Registers listeners on the specified window (either the main window or an iframe's window) to detect when the user has clicked somewhere or focused somewhere.

Users should call registerIframe() instead of this method.

Parameter Type Description
targetWindow Window
Optional

If specified this is the window associated with the iframe, i.e. iframe.contentWindow.

effectiveNode DomNode
Optional

If specified, report any focus events inside targetWindow as an event on effectiveNode, rather than on evt.target.

Returns:any | undefined

Handle to pass to unregisterWin()

unregisterIframe(handle)
Defined by dijit/_base/focus

Unregisters listeners on the specified iframe created by registerIframe. After calling be sure to delete or null out the handle itself.

Parameter Type Description
handle Object

Handle returned by registerIframe()

unregisterWin(handle)
Defined by dijit/_base/focus

Unregisters listeners on the specified window (either the main window or an iframe's window) according to handle returned from registerWin(). After calling be sure to delete or null out the handle itself.

Parameter Type Description
handle Handle
Error in the documentation? Can’t find what you are looking for? Let us know!