Home

# Class goog.ui.AttachableMenu

An implementation of a menu that can attach itself to DOM element that are annotated appropriately. The following attributes are used by the AttachableMenu menu-item - Should be set on DOM elements that function as items in the menu that can be selected. classNameSelected - A class that will be added to the element's class names when the item is selected via keyboard or mouse.

extends goog.ui.MenuBase

Instance Method Summary

`disposeInternal()`

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

    MyClass.prototype.disposeInternal = function() {
    MyClass.superClass_.disposeInternal.call(this);
    // Dispose logic for MyClass
    };

| `getAncestorMenuItem_((Element|null|undefined) elt) ⇒ ?Element` Returns the menu-item scoping the specified element, or null if there is none.
| `getItemClassName() ⇒ string` Sets the class name to use for menu items
| `getNextPrevItem(boolean prev) ⇒ ?Element` Returns the next or previous item. Used for up/down arrows.
| `getSelectedItem() ⇒ ?Element` Returns the selected item
| `getSelectedItemClassName() ⇒ string` Sets the class name to use for selected menu items todo(user) - reevaluate if we can simulate pseudo classes in IE
| `isMenuItem_((Element|null|undefined) elt) ⇒ boolean` Returns whether the specified element is a menu item.
| `onItemSelected_(?Object= opt_item)` Dispatch an ITEM_ACTION event when an item is selected
| `onKeyDown(?goog.events.KeyEvent e)` Key down handler for the menu.
| `onMouseOut(?goog.events.Event e)` Mouse out handler for the menu.
| `onMouseOver(?goog.events.Event e)` Mouse over handler for the menu.
| `onMouseUp(?goog.events.Event e)` Mouse up handler for the menu.
| `onShow_()` Called after the menu is shown.
| `selectByName_(string prefix, number= opt_direction, boolean= opt_skip)` Find an item that has the given prefix and select it.
| `setItemClassName(string name)` Sets the class name to use for menu items
| `setSelectedItem(?Element elt)` Sets the specified item as the selected element.
| `setSelectedItemClassName(string name)` Sets the class name to use for selected menu items todo(user) - reevaluate if we can simulate pseudo classes in IE
| `showPopupElement()` Shows the popup element.