function MenuItem(modelItem, tree) {
  var item = new cr.ui.TreeItem();
  // Get the original label id defined by TreeItem, before overwriting
  // prototype.
  var labelId = item.labelElement.id;
  item.__proto__ = MenuItem.prototype;

  item.parentTree_ = tree;
  item.modelItem_ = modelItem;
  item.innerHTML = MENU_TREE_ITEM_INNER_HTML;
  item.labelElement.id = labelId;
  item.label = modelItem.label;

  item.menuButton_ = /** @type {!cr.ui.MenuButton} */(queryRequiredElement(
        '.button', assert(item.firstElementChild)));
  item.menuButton_.setAttribute('menu', item.modelItem_.menu);
  cr.ui.MenuButton.decorate(item.menuButton_);

  var icon = queryRequiredElement('.icon', item);
  icon.setAttribute('menu-button-icon', item.modelItem_.icon);

  return item;
}
/**
 * A TreeItem which represents a command button.
 * Command items are displayed as top-level children of DirectoryTree.
 *
 * @param {!NavigationModelMenuItem} modelItem
 * @param {!DirectoryTree} tree Current tree, which contains this item.
 * @extends {cr.ui.TreeItem}
 * @constructor
 */
A TreeItem which represents a command button.
Command items are displayed as top-level children of DirectoryTree.

@param {!NavigationModelMenuItem} modelItem
@param {!DirectoryTree} tree Current tree, which contains this item.
A TreeItem which represents a command button . Command items are displayed as top - level children of DirectoryTree . @param { !NavigationModelMenuItem } modelItem @param { !DirectoryTree } tree Current tree which contains this item .
function MenuItem(modelItem, tree) {
  var item = new cr.ui.TreeItem();
  var labelId = item.labelElement.id;
  item.__proto__ = MenuItem.prototype;
  item.parentTree_ = tree;
  item.modelItem_ = modelItem;
  item.innerHTML = MENU_TREE_ITEM_INNER_HTML;
  item.labelElement.id = labelId;
  item.label = modelItem.label;
  item.menuButton_ = (queryRequiredElement(
        '.button', assert(item.firstElementChild)));
  item.menuButton_.setAttribute('menu', item.modelItem_.menu);
  cr.ui.MenuButton.decorate(item.menuButton_);
  var icon = queryRequiredElement('.icon', item);
  icon.setAttribute('menu-button-icon', item.modelItem_.icon);
  return item;
}
function MenuItem ( modelItem , tree ) { var item = new cr . ui . TreeItem ( ) ; var labelId = item . labelElement . id ; item . __proto__ = MenuItem . prototype ; item . parentTree_ = tree ; item . modelItem_ = modelItem ; item . innerHTML = MENU_TREE_ITEM_INNER_HTML ; item . labelElement . id = labelId ; item . label = modelItem . label ; item . menuButton_ = ( queryRequiredElement ( '.button' , assert ( item . firstElementChild ) ) ) ; item . menuButton_ . setAttribute ( 'menu' , item . modelItem_ . menu ) ; cr . ui . MenuButton . decorate ( item . menuButton_ ) ; var icon = queryRequiredElement ( '.icon' , item ) ; icon . setAttribute ( 'menu-button-icon' , item . modelItem_ . icon ) ; return item ; }
A TreeItem which represents a command button.
A TreeItem which represents a command button .
// Get the original label id defined by TreeItem, before overwriting // prototype. /** @type {!cr.ui.MenuButton} */