]>
Commit | Line | Data |
---|---|---|
f0cfe83e AD |
1 | define("dijit/Toolbar", [ |
2 | "require", | |
3 | "dojo/_base/declare", // declare | |
4 | "dojo/has", | |
5 | "dojo/keys", // keys.LEFT_ARROW keys.RIGHT_ARROW | |
6 | "dojo/ready", | |
7 | "./_Widget", | |
8 | "./_KeyNavContainer", | |
9 | "./_TemplatedMixin" | |
10 | ], function(require, declare, has, keys, ready, _Widget, _KeyNavContainer, _TemplatedMixin){ | |
11 | ||
12 | // module: | |
13 | // dijit/Toolbar | |
14 | ||
15 | ||
16 | // Back compat w/1.6, remove for 2.0 | |
17 | if(has("dijit-legacy-requires")){ | |
18 | ready(0, function(){ | |
19 | var requires = ["dijit/ToolbarSeparator"]; | |
20 | require(requires); // use indirection so modules not rolled into a build | |
21 | }); | |
22 | } | |
23 | ||
24 | return declare("dijit.Toolbar", [_Widget, _TemplatedMixin, _KeyNavContainer], { | |
25 | // summary: | |
26 | // A Toolbar widget, used to hold things like `dijit.Editor` buttons | |
27 | ||
28 | templateString: | |
29 | '<div class="dijit" role="toolbar" tabIndex="${tabIndex}" data-dojo-attach-point="containerNode">' + | |
30 | '</div>', | |
31 | ||
32 | baseClass: "dijitToolbar", | |
33 | ||
34 | postCreate: function(){ | |
35 | this.inherited(arguments); | |
36 | ||
37 | this.connectKeyNavHandlers( | |
38 | this.isLeftToRight() ? [keys.LEFT_ARROW] : [keys.RIGHT_ARROW], | |
39 | this.isLeftToRight() ? [keys.RIGHT_ARROW] : [keys.LEFT_ARROW] | |
40 | ); | |
41 | } | |
42 | }); | |
43 | }); |