]> git.wh0rd.org - tt-rss.git/blob - lib/dijit/DropDownMenu.js.uncompressed.js
make precache_headlines_idle() start slower
[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}\" 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 /*=====
13 var _MenuBase = dijit._MenuBase;
14 var _OnDijitClickMixin = dijit._OnDijitClickMixin;
15 =====*/
16
17 // module:
18 // dijit/DropDownMenu
19 // summary:
20 // dijit.DropDownMenu widget
21
22 return declare("dijit.DropDownMenu", [_MenuBase, _OnDijitClickMixin], {
23 // summary:
24 // A menu, without features for context menu (Meaning, drop down menu)
25
26 templateString: template,
27
28 baseClass: "dijitMenu",
29
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]);
35 },
36
37 _onKeyPress: function(/*Event*/ evt){
38 // summary:
39 // Handle keyboard based menu navigation.
40 // tags:
41 // protected
42
43 if(evt.ctrlKey || evt.altKey){ return; }
44
45 switch(evt.charOrCode){
46 case this._openSubMenuKey:
47 this._moveToPopup(evt);
48 event.stop(evt);
49 break;
50 case this._closeSubMenuKey:
51 if(this.parentMenu){
52 if(this.parentMenu._isMenuBar){
53 this.parentMenu.focusPrev();
54 }else{
55 this.onCancel(false);
56 }
57 }else{
58 event.stop(evt);
59 }
60 break;
61 }
62 }
63 });
64 });