You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
916 B
JavaScript
45 lines
916 B
JavaScript
define([
|
|
"dojo/_base/declare", // declare
|
|
"dojo/keys", // keys
|
|
"dojo/text!./templates/Menu.html",
|
|
"./_MenuBase"
|
|
], function(declare, keys, template, _MenuBase){
|
|
|
|
// module:
|
|
// dijit/DropDownMenu
|
|
|
|
return declare("dijit.DropDownMenu", _MenuBase, {
|
|
// summary:
|
|
// A menu, without features for context menu (Meaning, drop down menu)
|
|
|
|
templateString: template,
|
|
|
|
baseClass: "dijitMenu",
|
|
|
|
// Arrow key navigation
|
|
_onUpArrow: function(){
|
|
this.focusPrev();
|
|
},
|
|
_onDownArrow: function(){
|
|
this.focusNext();
|
|
},
|
|
_onRightArrow: function(/*Event*/ evt){
|
|
this._moveToPopup(evt);
|
|
evt.stopPropagation();
|
|
evt.preventDefault();
|
|
},
|
|
_onLeftArrow: function(/*Event*/ evt){
|
|
if(this.parentMenu){
|
|
if(this.parentMenu._isMenuBar){
|
|
this.parentMenu.focusPrev();
|
|
}else{
|
|
this.onCancel(false);
|
|
}
|
|
}else{
|
|
evt.stopPropagation();
|
|
evt.preventDefault();
|
|
}
|
|
}
|
|
});
|
|
});
|