X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/src/widgets/layout/MenuLayout.js?ds=sidebyside diff --git a/src/widgets/layout/MenuLayout.js b/src/widgets/layout/MenuLayout.js index d99abb0f..ca31b9d7 100644 --- a/src/widgets/layout/MenuLayout.js +++ b/src/widgets/layout/MenuLayout.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ /** * @class Ext.layout.MenuLayout @@ -12,6 +12,8 @@ Ext.layout.MenuLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize : true, + type: 'menu', + setContainer : function(ct){ this.monitorResize = !ct.floating; // This event is only fired by the menu in IE, used so we don't couple @@ -25,7 +27,7 @@ this.itemTpl = Ext.layout.MenuLayout.prototype.itemTpl = new Ext.XTemplate( '
  • ', '', - '', + '{altText}', '', '
  • ' ); @@ -50,7 +52,7 @@ if (!a.isMenuItem && a.needsIcon) { c.positionEl.addClass('x-menu-list-item-indent'); } - this.configureItem(c, position); + this.configureItem(c); }else if(c && !this.isValidParent(c, target)){ if(Ext.isNumber(position)){ position = target.dom.childNodes[position]; @@ -60,14 +62,17 @@ }, getItemArgs : function(c) { - var isMenuItem = c instanceof Ext.menu.Item; + var isMenuItem = c instanceof Ext.menu.Item, + canHaveIcon = !(isMenuItem || c instanceof Ext.menu.Separator); + return { isMenuItem: isMenuItem, - needsIcon: !isMenuItem && (c.icon || c.iconCls), + needsIcon: canHaveIcon && (c.icon || c.iconCls), icon: c.icon || Ext.BLANK_IMAGE_URL, iconCls: 'x-menu-item-icon ' + (c.iconCls || ''), itemId: 'x-menu-el-' + c.id, - itemCls: 'x-menu-list-item ' + itemCls: 'x-menu-list-item ', + altText: c.altText || '' }; }, @@ -94,4 +99,4 @@ } } }); -Ext.Container.LAYOUTS['menu'] = Ext.layout.MenuLayout; \ No newline at end of file +Ext.Container.LAYOUTS['menu'] = Ext.layout.MenuLayout;