]> git.wh0rd.org - tt-rss.git/blob - lib/dijit/DropDownMenu.js.uncompressed.js
upgrade dojo to 1.8.3 (refs #570)
[tt-rss.git] / lib / dijit / DropDownMenu.js.uncompressed.js
1 require({cache:{
2 'url:dijit/templates/Menu.html':"<table class=\"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable\" role=\"menu\" tabIndex=\"${tabIndex}\"\n\t 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
6 "dojo/keys", // keys
7 "dojo/text!./templates/Menu.html",
8 "./_OnDijitClickMixin",
9 "./_MenuBase"
10 ], function(declare, event, keys, template, _OnDijitClickMixin, _MenuBase){
11
12 // module:
13 // dijit/DropDownMenu
14
15 return declare("dijit.DropDownMenu", [_MenuBase, _OnDijitClickMixin], {
16 // summary:
17 // A menu, without features for context menu (Meaning, drop down menu)
18
19 templateString: template,
20
21 baseClass: "dijitMenu",
22
23 postCreate: function(){
24 this.inherited(arguments);
25 var l = this.isLeftToRight();
26 this._openSubMenuKey = l ? keys.RIGHT_ARROW : keys.LEFT_ARROW;
27 this._closeSubMenuKey = l ? keys.LEFT_ARROW : keys.RIGHT_ARROW;
28 this.connectKeyNavHandlers([keys.UP_ARROW], [keys.DOWN_ARROW]);
29 },
30
31 _onKeyPress: function(/*Event*/ evt){
32 // summary:
33 // Handle keyboard based menu navigation.
34 // tags:
35 // protected
36
37 if(evt.ctrlKey || evt.altKey){ return; }
38
39 switch(evt.charOrCode){
40 case this._openSubMenuKey:
41 this._moveToPopup(evt);
42 event.stop(evt);
43 break;
44 case this._closeSubMenuKey:
45 if(this.parentMenu){
46 if(this.parentMenu._isMenuBar){
47 this.parentMenu.focusPrev();
48 }else{
49 this.onCancel(false);
50 }
51 }else{
52 event.stop(evt);
53 }
54 break;
55 }
56 }
57 });
58 });