]> git.wh0rd.org - tt-rss.git/blame - lib/dijit/MenuBar.js
add dijit/dojo stuff; initial ui mockup
[tt-rss.git] / lib / dijit / MenuBar.js
CommitLineData
2f01fe57
AD
1/*
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
8if(!dojo._hasResource["dijit.MenuBar"]){
9dojo._hasResource["dijit.MenuBar"]=true;
10dojo.provide("dijit.MenuBar");
11dojo.require("dijit.Menu");
12dojo.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(){
13var k=dojo.keys,l=this.isLeftToRight();
14this.connectKeyNavHandlers(l?[k.LEFT_ARROW]:[k.RIGHT_ARROW],l?[k.RIGHT_ARROW]:[k.LEFT_ARROW]);
15this._orient=this.isLeftToRight()?{BL:"TL"}:{BR:"TR"};
16},focusChild:function(_1){
17var _2=this.focusedChild,_3=_2&&_2.popup&&_2.popup.isShowingNow;
18this.inherited(arguments);
19if(_3&&_1.popup&&!_1.disabled){
20this._openPopup();
21}
22},_onKeyPress:function(_4){
23if(_4.ctrlKey||_4.altKey){
24return;
25}
26switch(_4.charOrCode){
27case dojo.keys.DOWN_ARROW:
28this._moveToPopup(_4);
29dojo.stopEvent(_4);
30}
31},onItemClick:function(_5,_6){
32if(_5.popup&&_5.popup.isShowingNow){
33_5.popup.onCancel();
34}else{
35this.inherited(arguments);
36}
37}});
38}