66 lines
1.8 KiB
JavaScript
66 lines
1.8 KiB
JavaScript
//>>built
|
|
require({cache:{
|
|
'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"}});
|
|
define("dijit/DropDownMenu", [
|
|
"dojo/_base/declare", // declare
|
|
"dojo/_base/event", // event.stop
|
|
"dojo/keys", // keys
|
|
"dojo/text!./templates/Menu.html",
|
|
"./_OnDijitClickMixin",
|
|
"./_MenuBase"
|
|
], function(declare, event, keys, template, _OnDijitClickMixin, _MenuBase){
|
|
|
|
/*=====
|
|
var _MenuBase = dijit._MenuBase;
|
|
var _OnDijitClickMixin = dijit._OnDijitClickMixin;
|
|
=====*/
|
|
|
|
// module:
|
|
// dijit/DropDownMenu
|
|
// summary:
|
|
// dijit.DropDownMenu widget
|
|
|
|
return declare("dijit.DropDownMenu", [_MenuBase, _OnDijitClickMixin], {
|
|
// summary:
|
|
// A menu, without features for context menu (Meaning, drop down menu)
|
|
|
|
templateString: template,
|
|
|
|
baseClass: "dijitMenu",
|
|
|
|
postCreate: function(){
|
|
var l = this.isLeftToRight();
|
|
this._openSubMenuKey = l ? keys.RIGHT_ARROW : keys.LEFT_ARROW;
|
|
this._closeSubMenuKey = l ? keys.LEFT_ARROW : keys.RIGHT_ARROW;
|
|
this.connectKeyNavHandlers([keys.UP_ARROW], [keys.DOWN_ARROW]);
|
|
},
|
|
|
|
_onKeyPress: function(/*Event*/ evt){
|
|
// summary:
|
|
// Handle keyboard based menu navigation.
|
|
// tags:
|
|
// protected
|
|
|
|
if(evt.ctrlKey || evt.altKey){ return; }
|
|
|
|
switch(evt.charOrCode){
|
|
case this._openSubMenuKey:
|
|
this._moveToPopup(evt);
|
|
event.stop(evt);
|
|
break;
|
|
case this._closeSubMenuKey:
|
|
if(this.parentMenu){
|
|
if(this.parentMenu._isMenuBar){
|
|
this.parentMenu.focusPrev();
|
|
}else{
|
|
this.onCancel(false);
|
|
}
|
|
}else{
|
|
event.stop(evt);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
});
|