summaryrefslogtreecommitdiff
path: root/lib/dijit/MenuBar.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dijit/MenuBar.js')
-rw-r--r--lib/dijit/MenuBar.js79
1 files changed, 2 insertions, 77 deletions
diff --git a/lib/dijit/MenuBar.js b/lib/dijit/MenuBar.js
index 06d236b66..b6a1dfebe 100644
--- a/lib/dijit/MenuBar.js
+++ b/lib/dijit/MenuBar.js
@@ -1,77 +1,2 @@
-/*
- Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
- Available via Academic Free License >= 2.1 OR the modified BSD license.
- see: http://dojotoolkit.org/license for details
-*/
-
-
-if(!dojo._hasResource["dijit.MenuBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.MenuBar"] = true;
-dojo.provide("dijit.MenuBar");
-dojo.require("dijit.Menu");
-
-
-dojo.declare("dijit.MenuBar", dijit._MenuBase, {
- // summary:
- // A menu bar, listing menu choices horizontally, like the "File" menu in most desktop applications
-
- templateString: dojo.cache("dijit", "templates/MenuBar.html", "<div class=\"dijitMenuBar dijitMenuPassive\" dojoAttachPoint=\"containerNode\" role=\"menubar\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress: _onKeyPress\"></div>\n"),
-
- baseClass: "dijitMenuBar",
-
- // _isMenuBar: [protected] Boolean
- // This is a MenuBar widget, not a (vertical) Menu widget.
- _isMenuBar: true,
-
- postCreate: function(){
- var k = dojo.keys, l = this.isLeftToRight();
- this.connectKeyNavHandlers(
- l ? [k.LEFT_ARROW] : [k.RIGHT_ARROW],
- l ? [k.RIGHT_ARROW] : [k.LEFT_ARROW]
- );
-
- // parameter to dijit.popup.open() about where to put popup (relative to this.domNode)
- this._orient = this.isLeftToRight() ? {BL: 'TL'} : {BR: 'TR'};
- },
-
- focusChild: function(item){
- // overload focusChild so that whenever the focus is moved to a new item,
- // check the previous focused whether it has its popup open, if so, after
- // focusing the new item, open its submenu immediately
- var prev_item = this.focusedChild,
- showpopup = prev_item && prev_item.popup && prev_item.popup.isShowingNow;
- this.inherited(arguments);
- if(showpopup && item.popup && !item.disabled){
- this._openPopup(); // TODO: on down arrow, _openPopup() is called here and in onItemClick()
- }
- },
-
- _onKeyPress: function(/*Event*/ evt){
- // summary:
- // Handle keyboard based menu navigation.
- // tags:
- // protected
-
- if(evt.ctrlKey || evt.altKey){ return; }
-
- switch(evt.charOrCode){
- case dojo.keys.DOWN_ARROW:
- this._moveToPopup(evt);
- dojo.stopEvent(evt);
- }
- },
-
- onItemClick: function(/*dijit._Widget*/ item, /*Event*/ evt){
- // summary:
- // Handle clicks on an item. Cancels a dropdown if already open.
- // tags:
- // private
- if(item.popup && item.popup.isShowingNow){
- item.popup.onCancel();
- }else{
- this.inherited(arguments);
- }
- }
-});
-
-}
+//>>built
+require({cache:{"url:dijit/templates/MenuBar.html":"<div class=\"dijitMenuBar dijitMenuPassive\" data-dojo-attach-point=\"containerNode\" role=\"menubar\" tabIndex=\"${tabIndex}\" data-dojo-attach-event=\"onkeypress: _onKeyPress\"></div>\n"}});define("dijit/MenuBar",["dojo/_base/declare","dojo/_base/event","dojo/keys","./_MenuBase","dojo/text!./templates/MenuBar.html"],function(_1,_2,_3,_4,_5){return _1("dijit.MenuBar",_4,{templateString:_5,baseClass:"dijitMenuBar",_isMenuBar:true,postCreate:function(){var l=this.isLeftToRight();this.connectKeyNavHandlers(l?[_3.LEFT_ARROW]:[_3.RIGHT_ARROW],l?[_3.RIGHT_ARROW]:[_3.LEFT_ARROW]);this._orient=["below"];},focusChild:function(_6){var _7=this.focusedChild,_8=_7&&_7.popup&&_7.popup.isShowingNow;this.inherited(arguments);if(_8&&_6.popup&&!_6.disabled){this._openPopup();}},_onKeyPress:function(_9){if(_9.ctrlKey||_9.altKey){return;}switch(_9.charOrCode){case _3.DOWN_ARROW:this._moveToPopup(_9);_2.stop(_9);}},onItemClick:function(_a,_b){if(_a.popup&&_a.popup.isShowingNow){_a.popup.onCancel();}else{this.inherited(arguments);}}});}); \ No newline at end of file