root / trunk / web / dojo / dijit / MenuBar.js @ 12
History | View | Annotate | Download (1.31 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dijit.MenuBar"]){ |
||
9 | dojo._hasResource["dijit.MenuBar"]=true; |
||
10 | dojo.provide("dijit.MenuBar");
|
||
11 | dojo.require("dijit.Menu");
|
||
12 | dojo.declare("dijit.MenuBar",dijit._MenuBase,{templateString:dojo.cache("dijit","templates/MenuBar.html","<div class=\"dijitMenuBar dijitMenuPassive\" dojoAttachPoint=\"containerNode\" waiRole=\"menubar\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress: _onKeyPress\"></div>\n"),baseClass:"dijitMenuBar",_isMenuBar:true,postCreate:function(){ |
||
13 | var k=dojo.keys,l=this.isLeftToRight(); |
||
14 | this.connectKeyNavHandlers(l?[k.LEFT_ARROW]:[k.RIGHT_ARROW],l?[k.RIGHT_ARROW]:[k.LEFT_ARROW]);
|
||
15 | this._orient=this.isLeftToRight()?{BL:"TL"}:{BR:"TR"}; |
||
16 | },focusChild:function(_1){ |
||
17 | var _2=this.focusedChild,_3=_2&&_2.popup&&_2.popup.isShowingNow; |
||
18 | this.inherited(arguments); |
||
19 | if(_3&&_1.popup&&!_1.disabled){
|
||
20 | this._openPopup();
|
||
21 | } |
||
22 | },_onKeyPress:function(_4){ |
||
23 | if(_4.ctrlKey||_4.altKey){
|
||
24 | return;
|
||
25 | } |
||
26 | switch(_4.charOrCode){
|
||
27 | case dojo.keys.DOWN_ARROW:
|
||
28 | this._moveToPopup(_4);
|
||
29 | dojo.stopEvent(_4); |
||
30 | } |
||
31 | },onItemClick:function(_5,_6){ |
||
32 | if(_5.popup&&_5.popup.isShowingNow){
|
||
33 | _5.popup.onCancel(); |
||
34 | }else{
|
||
35 | this.inherited(arguments); |
||
36 | } |
||
37 | }}); |
||
38 | } |