]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/_base/manager.js.uncompressed.js
1 define("dijit/_base/manager", [
3 "dojo/_base/config", // defaultDuration
5 ".." // for setting exports to dijit namespace
6 ], function(array
, config
, registry
, dijit
){
11 // Shim to methods on registry, plus a few other declarations.
12 // New code should access dijit/registry directly when possible.
15 dijit.byId = function(id){
17 // Returns a widget by it's id, or if passed a widget, no-op (like dom.byId())
18 // id: String|dijit._Widget
19 return registry.byId(id); // dijit._Widget
22 dijit.getUniqueId = function(widgetType){
24 // Generates a unique id for a given widgetType
26 return registry.getUniqueId(widgetType); // String
29 dijit.findWidgets = function(root){
31 // Search subtree under root returning widgets found.
32 // Doesn't search for nested widgets (ie, widgets inside other widgets).
34 return registry.findWidgets(root);
37 dijit._destroyAll = function(){
39 // Code to destroy all widgets and do other cleanup on page unload
41 return registry._destroyAll();
44 dijit.byNode = function(node){
46 // Returns the widget corresponding to the given DOMNode
48 return registry.byNode(node); // dijit._Widget
51 dijit.getEnclosingWidget = function(node){
53 // Returns the widget whose DOM tree contains the specified DOMNode, or null if
54 // the node is not contained within the DOM tree of any widget
56 return registry.getEnclosingWidget(node);
59 array
.forEach(["byId", "getUniqueId", "findWidgets", "_destroyAll", "byNode", "getEnclosingWidget"], function(name
){
60 dijit
[name
] = registry
[name
];
65 // defaultDuration: Integer
66 // The default fx.animation speed (in ms) to use for all Dijit
67 // transitional fx.animations, unless otherwise specified
68 // on a per-instance basis. Defaults to 200, overrided by
69 // `djConfig.defaultDuration`
73 dijit
.defaultDuration
= config
["defaultDuration"] || 200;