X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/docs/source/MenuMgr.html?ds=sidebyside diff --git a/docs/source/MenuMgr.html b/docs/source/MenuMgr.html index faab37e1..7fefb3c8 100644 --- a/docs/source/MenuMgr.html +++ b/docs/source/MenuMgr.html @@ -1,11 +1,18 @@ - -
-/** + + + ++ \ No newline at end of fileThe source code + + + + +/*! + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license + */ +/** * @class Ext.menu.MenuMgr * Provides a common registry of all menu items on a page so that they can be easily accessed by id. * @singleton @@ -31,7 +38,9 @@ Ext.menu.MenuMgr = function(){ c.each(function(m){ m.hide(); }); + return true; } + return false; } // private @@ -55,7 +64,7 @@ Ext.menu.MenuMgr = function(){ if(m.parentMenu){ m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3); m.parentMenu.activeChild = m; - }else if(last && last.isVisible()){ + }else if(last && !last.isDestroyed && last.isVisible()){ m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3); } } @@ -88,25 +97,14 @@ Ext.menu.MenuMgr = function(){ } } - // private - function onBeforeCheck(mi, state){ - if(state){ - var g = groups[mi.group]; - for(var i = 0, l = g.length; i < l; i++){ - if(g[i] != mi){ - g[i].setChecked(false); - } - } - } - } - return { /** * Hides all menus that are currently visible + * @return {Boolean} success True if any active menus were hidden. */ hideAll : function(){ - hideAll(); + return hideAll(); }, // private @@ -115,18 +113,12 @@ Ext.menu.MenuMgr = function(){ init(); } menus[menu.id] = menu; - menu.on("beforehide", onBeforeHide); - menu.on("hide", onHide); - menu.on("beforeshow", onBeforeShow); - menu.on("show", onShow); - var g = menu.group; - if(g && menu.events["checkchange"]){ - if(!groups[g]){ - groups[g] = []; - } - groups[g].push(menu); - menu.on("checkchange", onCheck); - } + menu.on({ + beforehide: onBeforeHide, + hide: onHide, + beforeshow: onBeforeShow, + show: onShow + }); }, /** @@ -157,11 +149,6 @@ Ext.menu.MenuMgr = function(){ menu.un("hide", onHide); menu.un("beforeshow", onBeforeShow); menu.un("show", onShow); - var g = menu.group; - if(g && menu.events["checkchange"]){ - groups[g].remove(menu); - menu.un("checkchange", onCheck); - } }, // private @@ -172,7 +159,6 @@ Ext.menu.MenuMgr = function(){ groups[g] = []; } groups[g].push(menuItem); - menuItem.on("beforecheckchange", onBeforeCheck); } }, @@ -181,7 +167,23 @@ Ext.menu.MenuMgr = function(){ var g = menuItem.group; if(g){ groups[g].remove(menuItem); - menuItem.un("beforecheckchange", onBeforeCheck); + } + }, + + // private + onCheckChange: function(item, state){ + if(item.group && state){ + var group = groups[item.group], + i = 0, + len = group.length, + current; + + for(; i < len; i++){ + current = group[i]; + if(current != item){ + current.setChecked(false); + } + } } }, @@ -210,6 +212,6 @@ Ext.menu.MenuMgr = function(){ } }; }(); -- +