node-menunav-debug.js revision 8a4137ab24ac4a19400c698a65cf8ca511b081c5
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncYUI.add('node-menunav', function(Y) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync/**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <p>The MenuNav Node Plugin makes it easy to transform existing list-based markup into traditional,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* drop down navigational menus that are both accessible and easy to customize, and only require
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* a small set of dependencies.</p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <p>To use the MenuNav Node Plugin, simply pass a reference to the plugin to a Node instance's
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <code>plug</code> method.</p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <code>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* var oMenuNav = Y.Node.get("#productsandservices");<br>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* oMenuNav.plug(Y.Plugin.NodeMenuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* </code>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <p>The MenuNav Node Plugin has several configuration properties that can be set via an
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* object literal that is passed as a second argument to a Node instance's <code>plug</code> method.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* </p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <code>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* var oMenuNav = Y.Node.get("#productsandservices");<br>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* oMenuNav.plug(Y.Plugin.NodeMenuNav, { mouseOutHideDelay: 1000 });
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* </code>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* </p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <p> The complete list of the MenuNav Node Plugin configuration properties are:</p>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dl>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dt>useARIA</dt>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dd>Boolean indicating if use of the WAI-ARIA Roles and States should be enabled for the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* MenuNav. Set to true by default for Firefox 3 and Internet Explorer 8 as currently only
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* these browsers have support for ARIA, and are supported by several screen readers for
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* Windows that also offer support for ARIA.</dd>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dt>autoSubmenuDisplay</dt>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dd>Boolean indicating if submenus are automatically made visible when the user mouses over
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* the menu's items. Set to true by default.</dd>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dt>submenuShowDelay</dt>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dd>Number indicating the time (in milliseconds) that should expire before a submenu is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* made visible when the user mouses over the menu's label. Set to 250 by default.</dd>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dt>submenuHideDelay</dt>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dd>Number indicating the time (in milliseconds) that should expire before a submenu is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* hidden when the user mouses out of a menu label heading in the direction of a submenu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* Set to 250 by default.</dd>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dt>mouseOutHideDelay</dt>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* <dd>Number indicating the time (in milliseconds) that should expire before a submenu is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* hidden when the user mouses out of it. Set to 750 by default.</dd>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* </dl>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @module node-menunav
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*/
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Util shortcuts
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar UA = Y.UA,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Lang = Y.Lang,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync later = Y.later,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync getClassName = Y.ClassNameManager.getClassName,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Native types
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync TRUE = true,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync FALSE = false,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync NULL = null,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Frequently used strings
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync MENU = "menu",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync MENUITEM = "menuitem",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync HIDDEN = "hidden",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync TAB_INDEX = "tabIndex",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync PARENT_NODE = "parentNode",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CHILDREN = "children",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync OFFSET_HEIGHT = "offsetHeight",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync OFFSET_WIDTH = "offsetWidth",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync PX = "px",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync ID = "id",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync PERIOD = ".",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync HANDLED_MOUSEOUT = "handledMouseOut",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync HANDLED_MOUSEOVER = "handledMouseOver",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync ACTIVE = "active",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync LABEL = "label",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync LOWERCASE_A = "a",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync MOUSEDOWN = "mousedown",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync KEYDOWN = "keydown",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CLICK = "click",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync EMPTY_STRING = "",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync FIRST_OF_TYPE = "first-of-type",
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // CSS class names
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CSS_MENU = getClassName(MENU),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CSS_MENU_HIDDEN = getClassName(MENU, HIDDEN),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CSS_MENU_HORIZONTAL = getClassName(MENU, "horizontal"),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CSS_MENU_LABEL = getClassName(MENU, LABEL),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CSS_MENU_LABEL_ACTIVE = getClassName(MENU, LABEL, ACTIVE),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CSS_MENU_LABEL_MENUVISIBLE = getClassName(MENU, LABEL, (MENU + "visible")),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync CSS_MENUITEM = getClassName(MENUITEM),
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync CSS_MENUITEM_ACTIVE = getClassName(MENUITEM, ACTIVE),
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync // CSS selectors
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync
e7c4c205cb0af88b5ef0786be46da94847a9a37bvboxsync MENU_SELECTOR = PERIOD + CSS_MENU;
e7c4c205cb0af88b5ef0786be46da94847a9a37bvboxsync
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync// Utility functions
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// TO DO: Remove once Node implements circular functionality
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getPreviousSibling = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oPrevious = node.previous(),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oChildren;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (!oPrevious) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oChildren = node.get(PARENT_NODE).get(CHILDREN);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oPrevious = oChildren.item(oChildren.size() - 1);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return oPrevious;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// TO DO: Remove once Node implements circular functionality
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getNextSibling = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oNext = node.next(),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oChildren;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (!oNext) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oChildren = node.get(PARENT_NODE).get(CHILDREN);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNext = oChildren.item(0);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return oNext;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar setARIARole = function (node, role) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync node.setAttribute("role", role);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar setARIAProperty = function (node, property, value) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync node.setAttribute(("aria-" + property), value);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar setARIAPresentation = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIARole(node, "presentation");
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar removeFromTabIndex = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync node.set(TAB_INDEX, -1);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar placeInDefaultTabIndex = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync node.set(TAB_INDEX, 0);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsyncvar isAnchor = function (node) {
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync var bReturnVal = FALSE;
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync if (node) {
241adddf415cbdf66230864a215b24415f482e72vboxsync bReturnVal = node.get("nodeName").toLowerCase() === LOWERCASE_A;
241adddf415cbdf66230864a215b24415f482e72vboxsync }
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync return bReturnVal;
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync};
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar isMenuItem = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return node.hasClass(CSS_MENUITEM);
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync};
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar isMenuLabel = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync return node.hasClass(CSS_MENU_LABEL);
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync};
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsyncvar isHorizontalMenu = function (menu) {
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync return menu.hasClass(CSS_MENU_HORIZONTAL);
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar hasVisibleSubmenu = function (menuLabel) {
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync return menuLabel.hasClass(CSS_MENU_LABEL_MENUVISIBLE);
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync};
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsyncvar getItemAnchor = function (node) {
241adddf415cbdf66230864a215b24415f482e72vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return isAnchor(node) ? node : node.query(LOWERCASE_A);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsyncvar getNodeWithClass = function (node, className, searchAncestors) {
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync var oItem;
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync if (node) {
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync if (node.hasClass(className)) {
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync oItem = node;
a8ce9568e18b8c1a49833bf3b3ac2b2cc634b13cvboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync if (!oItem && searchAncestors) {
241adddf415cbdf66230864a215b24415f482e72vboxsync oItem = node.ancestor((PERIOD + className));
241adddf415cbdf66230864a215b24415f482e72vboxsync }
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync }
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync return oItem;
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync};
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsyncvar getParentMenu = function (node) {
241adddf415cbdf66230864a215b24415f482e72vboxsync
241adddf415cbdf66230864a215b24415f482e72vboxsync return node.ancestor(MENU_SELECTOR);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getMenu = function (node, searchAncestors) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return getNodeWithClass(node, CSS_MENU, searchAncestors);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getMenuItem = function (node, searchAncestors) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem = getNodeWithClass(node, CSS_MENUITEM, searchAncestors);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getMenuLabel = function (node, searchAncestors) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (searchAncestors) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem = getNodeWithClass(node, CSS_MENU_LABEL, searchAncestors);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem = getNodeWithClass(node, CSS_MENU_LABEL) || node.query((PERIOD + CSS_MENU_LABEL));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getItem = function (node, searchAncestors) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem = getMenuItem(node, searchAncestors) || getMenuLabel(node, searchAncestors);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getNextItem = function (item, previous) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oItemLI,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextLI,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (item) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync oItemLI = isMenuItem(item) ? item : item.get(PARENT_NODE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextLI = previous ? getPreviousSibling(oItemLI) : getNextSibling(oItemLI);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextItem = getItem(oNextLI);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return oNextItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getPreviousItem = function (item) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return getNextItem(item, true);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getFirstItem = function (menu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return getItem(menu.query("li"));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar getActiveClass = function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return isMenuItem(node) ? CSS_MENUITEM_ACTIVE : CSS_MENU_LABEL_ACTIVE;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar blurItem = function (item) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oAnchor = getItemAnchor(item);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // TO DO: Remove once implemented in Node
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync try {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oAnchor.blur();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync catch (ex) { }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar focusItem = function (item) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oAnchor = getItemAnchor(item);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // TO DO: Remove once implemented in Node
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync try {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oAnchor.focus();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync catch (ex) { }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar handleMouseOverForNode = function (node, target) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return node && !node[HANDLED_MOUSEOVER] && (node === target || node.contains(target));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar handleMouseOutForNode = function (node, relatedTarget) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return node && !node[HANDLED_MOUSEOUT] &&
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (node !== relatedTarget && !node.contains(relatedTarget));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync/**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @namespace Y.Plugin
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @class NodeMenuNav
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*/
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvar MenuNav = function (config) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu = config.owner,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oDocument,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync sID,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bUseARIA,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bAutoSubmenuDisplay,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync nMouseOutHideDelay,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuLabel,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuToggle,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oListNodes,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuNodes,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuItemContentNodes,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuLabelNodes,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oFirstItem,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oULs;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oRootMenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bUseARIA = config.useARIA;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bAutoSubmenuDisplay = config.autoSubmenuDisplay;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync nMouseOutHideDelay = config.mouseOutHideDelay;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Enable ARIA for Firefox 3 and IE 8 by default since those are the two browsers
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // that current support ARIA
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._useARIA = Lang.isBoolean(bUseARIA) ?
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bUseARIA : ((UA.gecko && UA.gecko >= 1.9) || (UA.ie && UA.ie >= 8));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._autoSubmenuDisplay =
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Lang.isBoolean(bAutoSubmenuDisplay) ? bAutoSubmenuDisplay : TRUE;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._submenuShowDelay = config.submenuShowDelay || 250;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._submenuHideDelay = config.submenuHideDelay || 250;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._mouseOutHideDelay = Lang.isNumber(nMouseOutHideDelay) ? nMouseOutHideDelay : 750;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Hide all visible submenus
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuNodes = oRootMenu.queryAll(MENU_SELECTOR);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oMenuNodes) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuNodes.addClass(CSS_MENU_HIDDEN);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oULs = oRootMenu.queryAll("ul:" + FIRST_OF_TYPE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oULs) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oULs.addClass(FIRST_OF_TYPE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Wire up all event handlers
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on("mouseover", menuNav._onMouseOver, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on("mouseout", menuNav._onMouseOut, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on("mousemove", menuNav._onMouseMove, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on(MOUSEDOWN, menuNav._toggleSubmenuDisplay, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on(KEYDOWN, menuNav._toggleSubmenuDisplay, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on(CLICK, menuNav._toggleSubmenuDisplay, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on("keypress", menuNav._onKeyPress, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu.on(KEYDOWN, menuNav._onKeyDown, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oDocument = oRootMenu.get("ownerDocument");
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oDocument.on(MOUSEDOWN, menuNav._onDocMouseDown, menuNav);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Y.on("focus", Y.bind(menuNav._onDocFocus, menuNav), oDocument);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._rootMenu = oRootMenu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (menuNav._useARIA) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIARole(oRootMenu, "menubar");
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oListNodes = oRootMenu.queryAll("ul,li");
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oListNodes) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oListNodes.each(function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIAPresentation(node);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync });
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuItemContentNodes = oRootMenu.queryAll((PERIOD + getClassName(MENUITEM, "content")));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oMenuItemContentNodes) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuItemContentNodes.each(function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync removeFromTabIndex(node);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIARole(node, MENUITEM);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync });
fd60bfdb327b9b1e7a6d084cf368fb7f07c566cfvboxsync
223935479ac42db56b7b7a7d16548d590022996avboxsync }
223935479ac42db56b7b7a7d16548d590022996avboxsync
223935479ac42db56b7b7a7d16548d590022996avboxsync
223935479ac42db56b7b7a7d16548d590022996avboxsync oMenuLabelNodes = oRootMenu.queryAll((PERIOD + CSS_MENU_LABEL));
fd60bfdb327b9b1e7a6d084cf368fb7f07c566cfvboxsync
fd60bfdb327b9b1e7a6d084cf368fb7f07c566cfvboxsync if (oMenuLabelNodes) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuLabelNodes.each(function (node) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuLabel = node;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuToggle = node.query((PERIOD + getClassName(MENU, "toggle")));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oMenuToggle) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIAPresentation(oMenuToggle);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync removeFromTabIndex(oMenuToggle);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenuLabel = oMenuToggle.previous();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIARole(oMenuLabel, MENUITEM);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIAProperty(oMenuLabel, "haspopup", TRUE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync removeFromTabIndex(oMenuLabel);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync sID = oMenuLabel.get(ID);
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync if (!sID) {
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync sID = Y.guid();
64863d3a0ffadf1ac248b295b78be5d55db6ee13vboxsync oMenuLabel.set(ID, sID);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = node.next();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIARole(oSubmenu, MENU);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIAProperty(oSubmenu, "labelledby", sID);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIAProperty(oSubmenu, HIDDEN, TRUE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync });
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oFirstItem = getFirstItem(oRootMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oFirstItem) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync placeInDefaultTabIndex(getItemAnchor(oFirstItem));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._firstItem = oFirstItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync};
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncMenuNav.NS = "MenuNav";
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync/**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @property menuNav.SHIM_TEMPLATE_TITLE
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @description String representing the value for the <code>title</code> attribute for the shim used
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* to prevent <code>&#60;select&#62;</code> elements from poking through menus in IE 6.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @default "Menu Stacking Shim"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @type String
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*/
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncMenuNav.SHIM_TEMPLATE_TITLE = "Menu Stacking Shim";
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync/**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @property menuNav.SHIM_TEMPLATE
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @description String representing the HTML used to create the <code>&#60;iframe&#62;</code> shim
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* used to prevent <code>&#60;select&#62;</code> elements from poking through menus in IE 6.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @default &#34;&#60;iframe frameborder=&#34;0&#34; tabindex=&#34;-1&#34;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* class=&#34;yui-shim&#34; title=&#34;Menu Stacking Shim&#34;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* src=&#34;javascript:false;&#34;&#62;&#60;/iframe&#62;&#34;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync* @type String
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync*/
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// <iframe> shim notes:
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync//
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// 1) Need to set the "frameBorder" property to 0 to suppress the default <iframe> border in IE.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// (Setting the CSS "border" property alone doesn't suppress it.)
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync//
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// 2) The "src" attribute of the <iframe> is set to "javascript:false;" so that it won't load a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// page inside it, preventing the secure/nonsecure warning in IE when using HTTPS.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync//
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// 3) Since the role of the <iframe> shim is completely presentational, its "tabindex" attribute
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// is set to "-1" and its title attribute is set to "Menu Stacking Shim". Both strategies help
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync// users of screen readers to avoid mistakenly interacting with the <iframe> shim.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncMenuNav.SHIM_TEMPLATE = '<iframe frameborder="0" tabindex="-1" class="' +
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync getClassName("shim") +
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync '" title="' + MenuNav.SHIM_TEMPLATE_TITLE +
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync '" src="javascript:false;"></iframe>';
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncMenuNav.prototype = {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Protected properties
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _rootMenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Node instance representing the root menu in the MenuNav.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default null
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Node
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _rootMenu: NULL,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _activeItem
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Node instance representing the MenuNav's active descendent - the menuitem or
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * menu label the user is currently interacting with.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default null
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Node
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _activeItem: NULL,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _activeMenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Node instance representing the menu that is the parent of the MenuNav's
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * active descendent.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default null
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Node
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _activeMenu: NULL,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _hasFocus
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Boolean indicating if the MenuNav has focus.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default false
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Boolean
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _hasFocus: FALSE,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
447cbf113f44132911fc13dc33cb26603759b82evboxsync // In gecko-based browsers a mouseover and mouseout event will fire even
447cbf113f44132911fc13dc33cb26603759b82evboxsync // if a DOM element moves out from under the mouse without the user actually
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // moving the mouse. This bug affects MenuNav because the user can hit the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Esc key to hide a menu, and if the mouse is over the menu when the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // user presses Esc, the _onMenuMouseOut handler will be called. To fix this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // bug the following flag (_blockMouseEvent) is used to block the code in the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // _onMenuMouseOut handler from executing.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _blockMouseEvent
447cbf113f44132911fc13dc33cb26603759b82evboxsync * @description Boolean indicating whether or not to handle the "mouseover" event.
447cbf113f44132911fc13dc33cb26603759b82evboxsync * @default false
447cbf113f44132911fc13dc33cb26603759b82evboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Boolean
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _blockMouseEvent: FALSE,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _currentMouseX
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Number representing the current x coordinate of the mouse inside the MenuNav.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default 0
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Number
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _currentMouseX: 0,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _movingToSubmenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Boolean indicating if the mouse is moving from a menu label to its
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * corresponding submenu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default false
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Boolean
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _movingToSubmenu: FALSE,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _showSubmenuTimer
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Timer used to show a submenu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default null
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Object
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _showSubmenuTimer: NULL,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _hideSubmenuTimer
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Timer used to hide a submenu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default null
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Object
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _hideSubmenuTimer: NULL,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _hideAllSubmenusTimer
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Timer used to hide a all submenus.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default null
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Object
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _hideAllSubmenusTimer: NULL,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _firstItem
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Node instance representing the first item (menuitem or menu label) in the root
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * menu of a MenuNav.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default null
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Node
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _firstItem: NULL,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @property _autoSubmenuDisplay
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Boolean indicating if submenus are automatically made visible when the user
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * mouses over the menu's items.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @default true
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @type Boolean
447cbf113f44132911fc13dc33cb26603759b82evboxsync */
4fac78486305f1f002adbf23953382e5d832af94vboxsync _autoSubmenuDisplay: TRUE,
447cbf113f44132911fc13dc33cb26603759b82evboxsync
447cbf113f44132911fc13dc33cb26603759b82evboxsync
447cbf113f44132911fc13dc33cb26603759b82evboxsync
447cbf113f44132911fc13dc33cb26603759b82evboxsync // Protected methods
447cbf113f44132911fc13dc33cb26603759b82evboxsync
447cbf113f44132911fc13dc33cb26603759b82evboxsync /**
4fac78486305f1f002adbf23953382e5d832af94vboxsync * @method _isRoot
447cbf113f44132911fc13dc33cb26603759b82evboxsync * @description Returns a boolean indicating if the specified menu is the root menu in
4fac78486305f1f002adbf23953382e5d832af94vboxsync * the MenuNav.
447cbf113f44132911fc13dc33cb26603759b82evboxsync * @protected
447cbf113f44132911fc13dc33cb26603759b82evboxsync * @param {Node} menu Node instance representing a menu.
447cbf113f44132911fc13dc33cb26603759b82evboxsync * @return {Boolean} Boolean indicating if the specified menu is the root menu in the MenuNav.
447cbf113f44132911fc13dc33cb26603759b82evboxsync */
4fac78486305f1f002adbf23953382e5d832af94vboxsync _isRoot: function (menu) {
447cbf113f44132911fc13dc33cb26603759b82evboxsync
447cbf113f44132911fc13dc33cb26603759b82evboxsync return this._rootMenu.compareTo(menu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _getTopmostSubmenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Returns the topmost submenu of a submenu hierarchy.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menu Node instance representing a menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @return {Node} Node instance representing a menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _getTopmostSubmenu: function (menu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenu = getParentMenu(menu),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync returnVal;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (!oMenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync returnVal = menu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else if (menuNav._isRoot(oMenu)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync returnVal = menu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync returnVal = menuNav._getTopmostSubmenu(oMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return returnVal;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _clearActiveItem
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Clears the MenuNav's active descendent.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _clearActiveItem: function () {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveItem = menuNav._activeItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oActiveItem) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveItem.removeClass(getActiveClass(oActiveItem));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (menuNav._useARIA) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync removeFromTabIndex(getItemAnchor(oActiveItem));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._activeItem = NULL;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _setActiveItem
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Sets the specified menuitem or menu label as the MenuNav's active descendent.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} item Node instance representing a menuitem or menu label.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _setActiveItem: function (item) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._clearActiveItem();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync item.addClass(getActiveClass(item));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (menuNav._useARIA) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync placeInDefaultTabIndex(getItemAnchor(item));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._activeItem = item;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _focusItem
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Focuses the specified menuitem or menu label.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} item Node instance representing a menuitem or menu label.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _focusItem: function (item) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (this._hasFocus) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Need to focus using a zero-second timeout to get Apple's VoiceOver to
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync // recognize that the focused item has changed
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync later(0, null, focusItem, item);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _showMenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Shows the specified menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menu Node instance representing a menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _showMenu: function (menu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oParentMenu = getParentMenu(menu),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oLI = menu.get(PARENT_NODE),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync aXY = oLI.getXY(),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oIFrame,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (isHorizontalMenu(oParentMenu)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync aXY[1] = aXY[1] + oLI.get(OFFSET_HEIGHT);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync aXY[0] = aXY[0] + oLI.get(OFFSET_WIDTH);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.setXY(aXY);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (UA.ie < 8) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (UA.ie === 6 && !menu.iframeShim) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.appendChild(Y.Node.create(MenuNav.SHIM_TEMPLATE));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.iframeShim = oIFrame;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Clear previous values for height and width
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.setStyles({ height: EMPTY_STRING, width: EMPTY_STRING });
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Set the width and height of the menu's bounding box - this is necessary for IE 6
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // so that the CSS for the <iframe> shim can simply set the <iframe>'s width and height
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // to 100% to ensure that dimensions of an <iframe> shim are always sync'd to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // that of its parent menu. Specifying a width and height also helps when positioning
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // decorator elements (for creating effects like rounded corners) inside a menu's
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // bounding box in IE 7.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.setStyles({
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync height: (menu.get(OFFSET_HEIGHT) + PX),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync width: (menu.get(OFFSET_WIDTH) + PX) });
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.previous().addClass(CSS_MENU_LABEL_MENUVISIBLE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.removeClass(CSS_MENU_HIDDEN);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (menuNav._useARIA) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync setARIAProperty(menu, HIDDEN, FALSE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem = getFirstItem(menu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._focusItem(oItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _hideMenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Hides the specified menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menu Node instance representing a menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Boolean} activateAndFocusLabel Boolean indicating if the label for the specified
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * menu should be focused and set as active.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _hideMenu: function (menu, activateAndFocusLabel) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oLabel = menu.previous(),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oLabel.removeClass(CSS_MENU_LABEL_MENUVISIBLE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (activateAndFocusLabel) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(oLabel);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._focusItem(oLabel);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveItem = menu.query((PERIOD + CSS_MENUITEM_ACTIVE));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oActiveItem) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveItem.removeClass(CSS_MENUITEM_ACTIVE);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Clear the values for top and left that were set by the call to "setXY" when the menu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // was shown so that the hidden position specified in the core CSS file will take affect.
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menu.setStyles({ left: EMPTY_STRING, top: EMPTY_STRING });
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync menu.addClass(CSS_MENU_HIDDEN);
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync setARIAProperty(menu, HIDDEN, TRUE);
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _hideAllSubmenus
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync * @description Hides all submenus of the specified menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menu Node instance representing a menu.
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _hideAllSubmenus: function (menu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenus = menu.queryAll(MENU_SELECTOR);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oSubmenus) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenus.each(Y.bind(function (submenuNode) {
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideMenu(submenuNode);
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync }, menuNav));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
b8908d384db2324f04a2f68a13e67ea32ebf609avboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
9c0076729ec8138e89ce8a6af9a772b68f1f8dc7vboxsync * @method _cancelShowSubmenuTimer
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Cancels the timer used to show a submenu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync _cancelShowSubmenuTimer: function () {
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync var menuNav = this,
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync oShowSubmenuTimer = menuNav._showSubmenuTimer;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oShowSubmenuTimer) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oShowSubmenuTimer.cancel();
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync menuNav._showSubmenuTimer = NULL;
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync }
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync },
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _cancelHideSubmenuTimer
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description Cancels the timer used to hide a submenu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync */
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync _cancelHideSubmenuTimer: function () {
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oHideSubmenuTimer = menuNav._hideSubmenuTimer;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync if (oHideSubmenuTimer) {
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync oHideSubmenuTimer.cancel();
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync menuNav._hideSubmenuTimer = NULL;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Event handlers for discrete pieces of pieces of the menu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _onMenuMouseOver
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description "mouseover" event handler for a menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menu Node instance representing a menu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Object} event Object representing the DOM event.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _onMenuMouseOver: function (menu, event) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oHideAllSubmenusTimer = menuNav._hideAllSubmenusTimer;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oHideAllSubmenusTimer) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oHideAllSubmenusTimer.cancel();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenusTimer = NULL;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._cancelHideSubmenuTimer();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._activeMenu = menu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (menuNav._movingToSubmenu && isHorizontalMenu(menu)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._movingToSubmenu = FALSE;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
ae56268ed43efa582cc3605ea0270106562a306dvboxsync * @method _onMenuMouseOut
ae56268ed43efa582cc3605ea0270106562a306dvboxsync * @description "mouseout" event handler for a menu.
ae56268ed43efa582cc3605ea0270106562a306dvboxsync * @protected
ae56268ed43efa582cc3605ea0270106562a306dvboxsync * @param {Node} menu Node instance representing a menu.
ae56268ed43efa582cc3605ea0270106562a306dvboxsync * @param {Object} event Object representing the DOM event.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _onMenuMouseOut: function (menu, event) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveMenu = menuNav._activeMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRelatedTarget = event.relatedTarget,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveItem = menuNav._activeItem,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oParentMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oActiveMenu && !oActiveMenu.contains(oRelatedTarget)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oParentMenu = getParentMenu(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oParentMenu && !oParentMenu.contains(oRelatedTarget)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (menuNav._mouseOutHideDelay > 0) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._cancelShowSubmenuTimer();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenusTimer =
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync later(menuNav._mouseOutHideDelay, menuNav, function () {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var oSubmenu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveMenu = menuNav._activeMenu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenus(menuNav._rootMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oActiveMenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Focus the label element for the topmost submenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._focusItem(oSubmenu.previous());
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync });
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oActiveItem) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oMenu = getParentMenu(oActiveItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (!menuNav._isRoot(oMenu)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._focusItem(oMenu.previous());
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _onMenuLabelMouseOver
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description "mouseover" event handler for a menu label.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menuLabel Node instance representing a menu label.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Object} event Object representing the DOM event.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _onMenuLabelMouseOver: function (menuLabel, event) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveMenu = menuNav._activeMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bIsRoot = menuNav._isRoot(oActiveMenu),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bUseAutoSubmenuDisplay = (menuNav._autoSubmenuDisplay && bIsRoot || !bIsRoot),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(menuLabel);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._focusItem(menuLabel);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (bUseAutoSubmenuDisplay && !menuNav._movingToSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._cancelHideSubmenuTimer();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._cancelShowSubmenuTimer();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (!hasVisibleSubmenu(menuLabel)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = menuLabel.next();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenus(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._showSubmenuTimer =
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync later(menuNav._submenuShowDelay, menuNav,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._showMenu, oSubmenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _onMenuLabelMouseOut
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description "mouseout" event handler for a menu label.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menuLabel Node instance representing a menu label.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Object} event Object representing the DOM event.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _onMenuLabelMouseOut: function (menuLabel, event) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bIsRoot = menuNav._isRoot(menuNav._activeMenu),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bUseAutoSubmenuDisplay = (menuNav._autoSubmenuDisplay && bIsRoot || !bIsRoot),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRelatedTarget = event.relatedTarget,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = menuLabel.next();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._clearActiveItem();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (bUseAutoSubmenuDisplay) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (menuNav._movingToSubmenu && !menuNav._showSubmenuTimer && oSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // If the mouse is moving diagonally toward the submenu and another submenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // isn't in the process of being displayed (via a timer), then hide the submenu
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // via a timer to give the user some time to reach the submenu.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideSubmenuTimer = later(menuNav._submenuHideDelay, menuNav,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideMenu, oSubmenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else if (!menuNav._movingToSubmenu && oSubmenu &&
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync !oSubmenu.contains(oRelatedTarget) && oRelatedTarget !== oSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // If the mouse is not moving toward the submenu, cancel any submenus that
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // might be in the process of being displayed (via a timer) and hide this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // submenu immediately.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._cancelShowSubmenuTimer();
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideMenu(oSubmenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _onMenuItemMouseOver
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description "mouseover" event handler for a menuitem.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menuItem Node instance representing a menuitem.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Object} event Object representing the DOM event.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _onMenuItemMouseOver: function (menuItem, event) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync oActiveMenu = menuNav._activeMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bIsRoot = menuNav._isRoot(oActiveMenu),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bUseAutoSubmenuDisplay = (menuNav._autoSubmenuDisplay && bIsRoot || !bIsRoot);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(menuItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._focusItem(menuItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (bUseAutoSubmenuDisplay && !menuNav._movingToSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenus(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _onMenuItemMouseOut
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description "mouseout" event handler for a menuitem.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Node} menuItem Node instance representing a menuitem.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Object} event Object representing the DOM event.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _onMenuItemMouseOut: function (menuItem, event) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync this._clearActiveItem();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @method _onVerticalMenuKeyDown
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @description "keydown" event handler for vertical menus of a MenuNav.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @param {Object} event Object representing the DOM event.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync _onVerticalMenuKeyDown: function (event) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveMenu = menuNav._activeMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oRootMenu = menuNav._rootMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oTarget = event.target,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oFocusedItem = getItem(oTarget, TRUE),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bPreventDefault = FALSE,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync nKeyCode = event.keyCode,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oParentMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oLI,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextItem,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync switch (nKeyCode) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case 37: // left arrow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oParentMenu = getParentMenu(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oParentMenu && isHorizontalMenu(oParentMenu)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideMenu(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oLI = getPreviousSibling(oActiveMenu.get(PARENT_NODE));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem = getItem(oLI);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oItem) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (isMenuLabel(oItem)) { // Menu label
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = oItem.next();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._showMenu(oSubmenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(getFirstItem(oSubmenu));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else { // MenuItem
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(oItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync focusItem(oItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else if (!menuNav._isRoot(oActiveMenu)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideMenu(oActiveMenu, TRUE);
447cbf113f44132911fc13dc33cb26603759b82evboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bPreventDefault = TRUE;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync break;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case 39: // right arrow
447cbf113f44132911fc13dc33cb26603759b82evboxsync
4fac78486305f1f002adbf23953382e5d832af94vboxsync if (isMenuLabel(oTarget)) {
447cbf113f44132911fc13dc33cb26603759b82evboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = oTarget.next();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._showMenu(oSubmenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(getFirstItem(oSubmenu));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else if (isHorizontalMenu(oRootMenu)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oLI = getNextSibling(oSubmenu.get(PARENT_NODE));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oItem = getItem(oLI);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenus(oRootMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync if (oItem) {
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (isMenuLabel(oItem)) { // Menu label
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = oItem.next();
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync if (oSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._showMenu(oSubmenu);
4791a729647f035b6561d292c9f848dd1fc797a9vboxsync menuNav._setActiveItem(getFirstItem(oSubmenu));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync else { // MenuItem
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(oItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync focusItem(oItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
6c221e25dc2b60524e787167348abb062dd89f3fvboxsync
6c221e25dc2b60524e787167348abb062dd89f3fvboxsync }
6c221e25dc2b60524e787167348abb062dd89f3fvboxsync
6c221e25dc2b60524e787167348abb062dd89f3fvboxsync }
6c221e25dc2b60524e787167348abb062dd89f3fvboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bPreventDefault = TRUE;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync break;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case 38: // up arrow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case 40: // down arrow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenus(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextItem = nKeyCode === 38 ?
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync getPreviousItem(oFocusedItem) : getNextItem(oFocusedItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(oNextItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync focusItem(oNextItem);
fd60bfdb327b9b1e7a6d084cf368fb7f07c566cfvboxsync
fd60bfdb327b9b1e7a6d084cf368fb7f07c566cfvboxsync bPreventDefault = TRUE;
223935479ac42db56b7b7a7d16548d590022996avboxsync
223935479ac42db56b7b7a7d16548d590022996avboxsync break;
223935479ac42db56b7b7a7d16548d590022996avboxsync
223935479ac42db56b7b7a7d16548d590022996avboxsync }
fd60bfdb327b9b1e7a6d084cf368fb7f07c566cfvboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (bPreventDefault) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // Prevent the browser from scrolling the window
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync event.preventDefault();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync },
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
d36016c7e22c0a816c7eae1b6d53f46b7d180589vboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync /**
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @method _onHorizontalMenuKeyDown
d36016c7e22c0a816c7eae1b6d53f46b7d180589vboxsync * @description "keydown" event handler for horizontal menus of a MenuNav.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @protected
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @param {Object} event Object representing the DOM event.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync */
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync _onHorizontalMenuKeyDown: function (event) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync var menuNav = this,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oActiveMenu = menuNav._activeMenu,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oTarget = event.target,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oFocusedItem = getItem(oTarget, TRUE),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bPreventDefault = FALSE,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync nKeyCode = event.keyCode,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextItem,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync switch (nKeyCode) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case 37: // left arrow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case 39: // right arrow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenus(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oNextItem = nKeyCode === 37 ?
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync getPreviousItem(oFocusedItem) : getNextItem(oFocusedItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(oNextItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync focusItem(oNextItem);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bPreventDefault = TRUE;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync break;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case 40: // down arrow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._hideAllSubmenus(oActiveMenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (isMenuLabel(oFocusedItem)) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync oSubmenu = oFocusedItem.next();
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if (oSubmenu) {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._showMenu(oSubmenu);
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync menuNav._setActiveItem(getFirstItem(oSubmenu));
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync bPreventDefault = TRUE;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync break;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (bPreventDefault) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync // Prevent the browser from scrolling the window
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync event.preventDefault();
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync },
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync // Generic DOM Event handlers
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync /**
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @method _onMouseMove
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @description "mousemove" event handler for the MenuNav.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @param {Object} event Object representing the DOM event.
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync */
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync _onMouseMove: function (event) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync var menuNav = this;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // Using a timer to set the value of the "_currentMouseX" property helps improve the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync // reliability of the calculation used to set the value of the "_movingToSubmenu"
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // property - especially in Opera.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync later(10, menuNav, function () {
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._currentMouseX = event.pageX;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync });
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync },
80e46f984efd827517661c0e081a36014ca41af8vboxsync
80e46f984efd827517661c0e081a36014ca41af8vboxsync
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /**
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync * @method _onMouseOver
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @description "mouseover" event handler for the MenuNav.
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync * @protected
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @param {Object} event Object representing the DOM event.
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync */
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync _onMouseOver: function (event) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync var menuNav = this,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oTarget,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuLabel,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oParentMenu,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (menuNav._blockMouseEvent) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._blockMouseEvent = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync else {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oTarget = event.target;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu = getMenu(oTarget, TRUE);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuLabel = getMenuLabel(oTarget, TRUE);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem = getMenuItem(oTarget, TRUE);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (handleMouseOverForNode(oMenu, oTarget)) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._onMenuMouseOver(oMenu, event);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu[HANDLED_MOUSEOVER] = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu[HANDLED_MOUSEOUT] = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oParentMenu = getParentMenu(oMenu);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (oParentMenu) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oParentMenu[HANDLED_MOUSEOUT] = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oParentMenu[HANDLED_MOUSEOVER] = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
223935479ac42db56b7b7a7d16548d590022996avboxsync }
223935479ac42db56b7b7a7d16548d590022996avboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (handleMouseOverForNode(oMenuLabel, oTarget)) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._onMenuLabelMouseOver(oMenuLabel, event);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuLabel[HANDLED_MOUSEOVER] = TRUE;
223935479ac42db56b7b7a7d16548d590022996avboxsync oMenuLabel[HANDLED_MOUSEOUT] = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (handleMouseOverForNode(oMenuItem, oTarget)) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._onMenuItemMouseOver(oMenuItem, event);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem[HANDLED_MOUSEOVER] = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem[HANDLED_MOUSEOUT] = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync },
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync /**
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @method _onMouseOut
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @description "mouseout" event handler for the MenuNav.
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @protected
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @param {Object} event Object representing the DOM event.
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync */
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync _onMouseOut: function (event) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync var menuNav = this,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oActiveMenu = menuNav._activeMenu,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync bMovingToSubmenu = FALSE,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oTarget,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oRelatedTarget,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuLabel,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oSubmenu,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._movingToSubmenu = (oActiveMenu && !isHorizontalMenu(oActiveMenu) &&
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync ((event.pageX - 5) > menuNav._currentMouseX));
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oTarget = event.target;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oRelatedTarget = event.relatedTarget;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu = getMenu(oTarget, TRUE);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuLabel = getMenuLabel(oTarget, TRUE);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem = getMenuItem(oTarget, TRUE);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (handleMouseOutForNode(oMenuLabel, oRelatedTarget)) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._onMenuLabelMouseOut(oMenuLabel, event);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuLabel[HANDLED_MOUSEOUT] = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuLabel[HANDLED_MOUSEOVER] = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (handleMouseOutForNode(oMenuItem, oRelatedTarget)) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._onMenuItemMouseOut(oMenuItem, event);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem[HANDLED_MOUSEOUT] = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenuItem[HANDLED_MOUSEOVER] = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (oMenuLabel) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oSubmenu = oMenuLabel.next();
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (oSubmenu && (oRelatedTarget === oSubmenu || oSubmenu.contains(oRelatedTarget))) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync bMovingToSubmenu = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (handleMouseOutForNode(oMenu, oRelatedTarget) || bMovingToSubmenu) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._onMenuMouseOut(oMenu, event);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu[HANDLED_MOUSEOUT] = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oMenu[HANDLED_MOUSEOVER] = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync },
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
80e46f984efd827517661c0e081a36014ca41af8vboxsync
80e46f984efd827517661c0e081a36014ca41af8vboxsync /**
80e46f984efd827517661c0e081a36014ca41af8vboxsync * @method _toggleSubmenuDisplay
80e46f984efd827517661c0e081a36014ca41af8vboxsync * @description "mousedown," "keydown," and "click" event handler for the MenuNav used to
80e46f984efd827517661c0e081a36014ca41af8vboxsync * toggle the display of a submenu.
80e46f984efd827517661c0e081a36014ca41af8vboxsync * @protected
80e46f984efd827517661c0e081a36014ca41af8vboxsync * @param {Object} event Object representing the DOM event.
80e46f984efd827517661c0e081a36014ca41af8vboxsync */
80e46f984efd827517661c0e081a36014ca41af8vboxsync _toggleSubmenuDisplay: function (event) {
80e46f984efd827517661c0e081a36014ca41af8vboxsync
80e46f984efd827517661c0e081a36014ca41af8vboxsync var menuNav = this,
80e46f984efd827517661c0e081a36014ca41af8vboxsync oTarget = event.target,
80e46f984efd827517661c0e081a36014ca41af8vboxsync oMenuLabel = getMenuLabel(oTarget, TRUE),
80e46f984efd827517661c0e081a36014ca41af8vboxsync sType = event.type,
80e46f984efd827517661c0e081a36014ca41af8vboxsync oAnchor,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oSubmenu,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync sHref,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync nHashPos,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync nLen,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync sId;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (oMenuLabel) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oAnchor = isAnchor(oTarget) ? oTarget : oTarget.ancestor(isAnchor);
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync if (oAnchor) {
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync // Need to pass "2" as a second argument to "getAttribute" for IE otherwise IE
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync // will return a fully qualified URL for the value of the "href" attribute.
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync // http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync sHref = oAnchor.getAttribute("href", 2);
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync nHashPos = sHref.indexOf("#");
1e9377d042fa2ea3e2cd78805678f23f64db55f6vboxsync nLen = sHref.length;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (nHashPos === 0 && nLen > 1) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync sId = sHref.substr(1, nLen);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync oSubmenu = oMenuLabel.next();
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (oSubmenu && (oSubmenu.get(ID) === sId)) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (sType === MOUSEDOWN || (sType === KEYDOWN && event.keyCode === 13)) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // The call to "preventDefault" below results in the element
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // serving as the menu's label to not receive focus in Webkit,
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // therefore the "_hasFocus" flag never gets set to true, meaning the
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // first item in the submenu isn't focused when the submenu is
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // displayed. To fix this issue, it is necessary to set the
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // "_hasFocus" flag to true.
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (UA.webkit && !menuNav._hasFocus) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._hasFocus = TRUE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync if (hasVisibleSubmenu(oMenuLabel)) {
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync menuNav._hideMenu(oSubmenu);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync focusItem(oMenuLabel);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync else {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._hideAllSubmenus(menuNav._rootMenu);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync menuNav._showMenu(oSubmenu);
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (sType === CLICK) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // Prevent the browser from following the URL of the anchor element
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync event.preventDefault();
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync },
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync /**
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @method _onKeyPress
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @description "keypress" event handler for the MenuNav.
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @protected
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @param {Object} event Object representing the DOM event.
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync */
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync _onKeyPress: function (event) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync switch (event.keyCode) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync case 37: // left arrow
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync case 38: // up arrow
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync case 39: // right arrow
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync case 40: // down arrow
859c9a7cc74066a52cf7e76d54169859e7705c3dvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync // Prevent the browser from scrolling the window
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync event.preventDefault();
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync break;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync },
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync /**
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @method _onKeyDown
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync * @description "keydown" event handler for the MenuNav.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * @protected
d36016c7e22c0a816c7eae1b6d53f46b7d180589vboxsync * @param {Object} event Object representing the DOM event.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync */
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync _onKeyDown: function (event) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync var menuNav = this,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oActiveItem = menuNav._activeItem,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oTarget = event.target,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oActiveMenu = getParentMenu(oTarget);
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (oActiveMenu) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._activeMenu = oActiveMenu;
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (isHorizontalMenu(oActiveMenu)) {
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync menuNav._onHorizontalMenuKeyDown(event);
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync else {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._onVerticalMenuKeyDown(event);
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (event.keyCode === 27) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (!menuNav._isRoot(oActiveMenu)) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._hideMenu(oActiveMenu, TRUE);
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync event.stopPropagation();
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._blockMouseEvent = UA.gecko ? TRUE : FALSE;
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync else if (oActiveItem) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync blurItem(oTarget);
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._clearActiveItem();
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync },
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync /**
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @method _onDocMouseDown
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @description "mousedown" event handler for the owner document of the MenuNav.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @protected
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @param {Object} event Object representing the DOM event.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync */
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync _onDocMouseDown: function (event) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync var menuNav = this,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oRoot = menuNav._rootMenu,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oTarget = event.target;
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (!oRoot.compareTo(oTarget) && !oRoot.contains(oTarget)) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._hideAllSubmenus(oRoot);
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync // Document doesn't receive focus in Webkit when the user mouses down on it,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync // so the "_hasFocus" property won't get set to the correct value. The
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync // following line corrects the problem.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (UA.webkit) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._hasFocus = FALSE;
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._clearActiveItem();
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync },
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync /**
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @method _onDocFocus
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @description "focus" event handler for the owner document of the MenuNav.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @protected
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync * @param {Object} event Object representing the DOM event.
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync */
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync _onDocFocus: function (event) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync var menuNav = this,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync bUseARIA = menuNav._useARIA,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oFirstItem = menuNav._firstItem,
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oActiveItem = menuNav._activeItem,
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync oTarget = event.target;
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync if (menuNav._rootMenu.contains(oTarget)) { // The menu has focus
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync if (!menuNav._hasFocus) { // Initial focus
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync
0839fbd6b31c4c9a2ea76750df48a30dffd4ad77vboxsync // First time the menu has been focused, need to setup focused state and
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync // established active active descendant
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._hasFocus = TRUE;
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync oActiveItem = getItem(oTarget, TRUE);
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync if (oActiveItem) {
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync menuNav._setActiveItem(oActiveItem);
30a7a1ba4558de8e809ab4bdbd82a713d67e59abvboxsync }
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync }
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync }
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync else { // The menu has lost focus
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync menuNav._clearActiveItem();
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync menuNav._hasFocus = FALSE;
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync if (oFirstItem && bUseARIA) {
cf289c84a0ecd24e5808b46b70d545cdc2c8805cvboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync placeInDefaultTabIndex(getItemAnchor(oFirstItem));
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync }
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync }
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync }
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync};
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsyncY.namespace('Plugin');
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsyncY.Plugin.NodeMenuNav = MenuNav;
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync}, '@VERSION@' ,{requires:['node', 'classnamemanager']});
fa2d3f7a92b98db2c47964694f4b7e1aa67a3b10vboxsync