The dijit package main module. Deprecated. Users should access individual modules (ex: dijit/registry) directly.
List of currently active widgets (focused widget and it's ancestors)
The default fx.animation speed (in ms) to use for all Dijit
transitional fx.animations, unless otherwise specified
on a per-instance basis. Defaults to 200, overrided by
djConfig.defaultDuration
Code to place a DOMNode relative to another DOMNode. Load using require(["dijit/place"], function(place){ ... }).
These functions are used to repetitively call a user specified callback method when a specific key or mouse click over a specific DOM node is held down for a specific amount of time. Only 1 such event is allowed to occur on the browser page at 1 time.
Finds descendants of the specified root node.
Finds the following descendants of the specified root node:
Parameter | Type | Description |
---|---|---|
root | DOMNode |
Parameter | Type | Description |
---|---|---|
element | DomNode | |
start | Number |
Optional
|
stop | Number |
Optional
|
For IE/FF z-index shenanigans. id attribute is required.
new dijit.BackgroundIframe(node).
Makes a background iframe as a child of node, that fills area (and position) of node
Parameter | Type | Description |
---|---|---|
node | DomNode |
Returns effective tabIndex of an element, either a number, or undefined if element isn't focusable.
Parameter | Type | Description |
---|---|---|
elem | Element |
Retrieves a bookmark that can be used with moveToBookmark to return to the same range
Finds the descendant of the specified root node that is first in the tabbing order
Parameter | Type | Description |
---|---|---|
root | String | DOMNode | |
doc | Document |
Optional
|
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 |
A handle to restore focus/selection, to be passed to dijit.focus
Finds the descendant of the specified root node that is last in the tabbing order
Parameter | Type | Description |
---|---|---|
root | String | DOMNode | |
doc | Document |
Optional
|
Deprecated method, unneeded when using dijit/place directly. Transforms the passed array of preferred positions into a format suitable for passing as the aroundCorners argument to dijit/place.placeOnScreenAroundElement.
Parameter | Type | Description |
---|---|---|
position | String[] | This variable controls the position of the drop down. It's an array of strings with the following values:
The list is positions is tried, in order, until a position is found where the drop down fits within the viewport. |
leftToRight | Boolean | Whether the popup will be displaying in leftToRight mode. |
Deprecated method to return the dimensions and scroll position of the viewable area of a browser window. New code should use windowUtils.getBox()
Gets the role for an element (which should be a wai role).
Parameter | Type | Description |
---|---|---|
elem | Element |
The role of elem or an empty string if elem does not have a role.
Gets the value of a state on an element.
Checks for an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String |
The value of the requested state on elem or an empty string if elem has no value for state.
Tests if element is tab-navigable even without an explicit tabIndex setting
Parameter | Type | Description |
---|---|---|
elem | Element |
Determines if an element has a particular role.
Parameter | Type | Description |
---|---|---|
elem | Element | |
role | String |
Optional
|
True if elem has the specific role attribute and false if not. For backwards compatibility if role parameter not provided, returns true if has a role
Determines if an element has a given state.
Checks for an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String |
true if elem has a value for the given state and false if it does not.
Static method to hide the tooltip displayed via showTooltip()
Parameter | Type | Description |
---|---|---|
aroundNode | undefined |
Tests if an element is focusable by tabbing to it, or clicking it with the mouse.
Parameter | Type | Description |
---|---|---|
elem | Element |
Tests if an element is tab-navigable
Parameter | Type | Description |
---|---|---|
elem | Element |
Moves current selection to a bookmark
Parameter | Type | Description |
---|---|---|
bookmark | Object | This should be a returned object from dijit.getBookmark() |
Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of padding.x 2 and padding.y 2, or zero if padding not specified. Picks first corner in corners[] where node is fully visible, or the corner where it's most visible.
Node is assumed to be absolutely or relatively positioned.
Parameter | Type | Description |
---|---|---|
node | DOMNode | The node to position |
pos | dijit/place.__Position | Object like {x: 10, y: 20} |
corners | String[] | Array of Strings representing order to try corners of the node in, like ["TR", "BL"]. Possible values are:
|
padding | dijit/place.__Position |
Optional Optional param to set padding, to put some buffer around the element you want to position. Defaults to zero. |
layoutNode | undefined | For things like tooltip, they are displayed differently (and have different dimensions) based on their orientation relative to the parent. This adjusts the popup based on orientation. |
Try to place node's top right corner at (10,20). If that makes node go (partially) off screen, then try placing bottom left corner at (10,20).
place(node, {x: 10, y: 20}, ["TR", "BL"])
Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object for the "around" argument and finds a proper processor to place a node. Deprecated, new code should use dijit/place.around() instead.
Parameter | Type | Description |
---|---|---|
node | undefined | |
aroundNode | undefined | |
aroundCorners | undefined | |
layoutNode | undefined |
Position node adjacent or kitty-corner to aroundNode such that it's fully visible in viewport. Deprecated, new code should use dijit/place.around() instead.
Parameter | Type | Description |
---|---|---|
node | undefined | |
aroundNode | undefined | |
aroundCorners | undefined | |
layoutNode | undefined |
Like dijit.placeOnScreenAroundNode(), except that the "around" parameter is an arbitrary rectangle on the screen (x, y, width, height) instead of a dom node. Deprecated, new code should use dijit/place.around() instead.
Parameter | Type | Description |
---|---|---|
node | undefined | |
aroundRect | undefined | |
aroundCorners | undefined | |
layoutNode | undefined |
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 |
Handle to pass to unregisterIframe()
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. |
Handle to pass to unregisterWin()
Removes the specified role from an element. Removes role attribute if no specific role provided (for backwards compat.)
Parameter | Type | Description |
---|---|---|
elem | Element | |
role | String |
Removes a state from an element.
Sets an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String |
Scroll the passed node into view, if it is not already.
Deprecated, use windowUtils.scrollIntoView
instead.
Parameter | Type | Description |
---|---|---|
node | DomNode | |
pos | Object |
Optional
|
Select text in the input element argument, from start (default 0), to stop (default end).
Parameter | Type | Description |
---|---|---|
element | DomNode | |
start | Number |
Optional
|
stop | Number |
Optional
|
Sets the role on an element.
Replace existing role attribute with new role.
Parameter | Type | Description |
---|---|---|
elem | Element | |
role | String |
Sets a state on an element.
Sets an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String | |
value | String |
Static method to display tooltip w/specified contents in specified position. See description of dijit/Tooltip.defaultPosition for details on position parameter. If position is not specified then dijit/Tooltip.defaultPosition is used.
Parameter | Type | Description |
---|---|---|
innerHTML | String | Contents of the tooltip |
aroundNode | Object | Specifies that tooltip should be next to this node / area |
position | String[] |
Optional List of positions to try to position tooltip (ex: ["right", "above"]) |
rtl | Boolean |
Optional Corresponds to |
textDir | String |
Optional Corresponds to |
onMouseEnter | Function |
Optional Callback function for mouse over on tooltip |
onMouseLeave | Function |
Optional Callback function for mouse leave on tooltip |
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() |
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 |