]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/DropDownMenu.js.uncompressed.js
2 'url:dijit/templates/Menu.html':"<table class=\"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable\" role=\"menu\" tabIndex=\"${tabIndex}\" data-dojo-attach-event=\"onkeypress:_onKeyPress\" cellspacing=\"0\">\n\t<tbody class=\"dijitReset\" data-dojo-attach-point=\"containerNode\"></tbody>\n</table>\n"}});
3 define("dijit/DropDownMenu", [
4 "dojo/_base/declare", // declare
5 "dojo/_base/event", // event.stop
7 "dojo/text!./templates/Menu.html",
8 "./_OnDijitClickMixin",
10 ], function(declare
, event
, keys
, template
, _OnDijitClickMixin
, _MenuBase
){
13 var _MenuBase = dijit._MenuBase;
14 var _OnDijitClickMixin = dijit._OnDijitClickMixin;
20 // dijit.DropDownMenu widget
22 return declare("dijit.DropDownMenu", [_MenuBase
, _OnDijitClickMixin
], {
24 // A menu, without features for context menu (Meaning, drop down menu)
26 templateString
: template
,
28 baseClass
: "dijitMenu",
30 postCreate: function(){
31 var l
= this.isLeftToRight();
32 this._openSubMenuKey
= l
? keys
.RIGHT_ARROW
: keys
.LEFT_ARROW
;
33 this._closeSubMenuKey
= l
? keys
.LEFT_ARROW
: keys
.RIGHT_ARROW
;
34 this.connectKeyNavHandlers([keys
.UP_ARROW
], [keys
.DOWN_ARROW
]);
37 _onKeyPress: function(/*Event*/ evt
){
39 // Handle keyboard based menu navigation.
43 if(evt
.ctrlKey
|| evt
.altKey
){ return; }
45 switch(evt
.charOrCode
){
46 case this._openSubMenuKey
:
47 this._moveToPopup(evt
);
50 case this._closeSubMenuKey
:
52 if(this.parentMenu
._isMenuBar
){
53 this.parentMenu
.focusPrev();