]>
git.proxmox.com Git - sencha-touch.git/blob - src/src/Menu.js
2 * {@link Ext.Menu}'s are used with {@link Ext.Viewport#setMenu}. A menu can be linked with any side of the screen (top, left, bottom or right)
3 * and will simply describe the contents of your menu. To use this menu you will call various menu related functions on the {@link Ext.Viewport}
4 * such as {@link Ext.Viewport#showMenu}, {@link Ext.Viewport#hideMenu}, {@link Ext.Viewport#toggleMenu}, {@link Ext.Viewport#hideOtherMenus},
5 * or {@link Ext.Viewport#hideAllMenus}.
8 * var menu = Ext.create('Ext.Menu', {
25 * Ext.Viewport.setMenu(menu, {
30 * Ext.Viewport.showMenu('left');
32 * The {@link #defaultType} of a Menu item is a {@link Ext.Button button}.
34 Ext
.define('Ext.Menu', {
37 requires
: ['Ext.Button'],
44 baseCls
: Ext
.baseCSSPrefix
+ 'menu',
80 defaultType
: 'button',
116 translationMethod
: null
120 constructor: function() {
121 this.config
.translatable
.translationMethod
= Ext
.browser
.is
.AndroidStock2
? 'cssposition' : 'csstransform';
122 this.callParent(arguments
);
128 theme
: ['Blackberry', 'Blackberry103'],
135 updateUi: function(newUi
, oldUi
) {
136 this.callParent(arguments
);
138 if (newUi
!= oldUi
&& (Ext
.theme
.is
.Blackberry
|| Ext
.theme
.is
.Blackberry103
)) {
139 if (newUi
== 'context') {
140 this.innerElement
.swapCls('x-vertical', 'x-horizontal');
142 else if (newUi
== 'application') {
143 this.innerElement
.swapCls('x-horizontal', 'x-vertical');
148 updateHideOnMaskTap : function(hide
) {
149 var mask
= this.getModal();
152 mask
[hide
? 'on' : 'un'].call(mask
, 'tap', function() {
153 Ext
.Viewport
.hideMenu(this.$side
);
159 * Only fire the hide event if it is initialized
161 doSetHidden: function() {
162 if (this.initialized
) {
163 this.callParent(arguments
);