diff options
author | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
---|---|---|
committer | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
commit | 7c97d17aaf373339a8bcd917ad59ca6018148f0d (patch) | |
tree | 5a3c04f0f9529be392c1263d3feb75806eb43797 /lib/dijit/DropDownMenu.js.uncompressed.js | |
parent | 70db7424e7068701e60cc5bcdfe8f858be508179 (diff) | |
parent | c670a80ddd9b03bd4ea6d940a9ed682fd26248d7 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'lib/dijit/DropDownMenu.js.uncompressed.js')
-rw-r--r-- | lib/dijit/DropDownMenu.js.uncompressed.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/dijit/DropDownMenu.js.uncompressed.js b/lib/dijit/DropDownMenu.js.uncompressed.js new file mode 100644 index 000000000..0d5234c98 --- /dev/null +++ b/lib/dijit/DropDownMenu.js.uncompressed.js @@ -0,0 +1,58 @@ +require({cache:{ +'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"}}); +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){ + + // module: + // dijit/DropDownMenu + + return declare("dijit.DropDownMenu", [_MenuBase, _OnDijitClickMixin], { + // summary: + // A menu, without features for context menu (Meaning, drop down menu) + + templateString: template, + + baseClass: "dijitMenu", + + postCreate: function(){ + this.inherited(arguments); + 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; + } + } + }); +}); |