function SubDirectoryItem(label, dirEntry, parentDirItem, tree) {
  var item = new DirectoryItem(label, tree);
  item.__proto__ = SubDirectoryItem.prototype;

  item.entry = dirEntry;
  item.delayExpansion = parentDirItem.delayExpansion;

  if (item.delayExpansion) {
    item.clearHasChildren();
    item.mayHaveChildren_ = true;
  }

  // Sets up icons of the item.
  var icon = item.querySelector('.icon');
  icon.classList.add('item-icon');
  var location = tree.volumeManager.getLocationInfo(item.entry);
  if (location && location.rootType && location.isRootEntry) {
    icon.setAttribute('volume-type-icon', location.rootType);
  } else {
    icon.setAttribute('file-type-icon', 'folder');
    item.updateSharedStatusIcon();
  }

  // Sets up context menu of the item.
  if (tree.contextMenuForSubitems && !util.isTeamDriveRoot(dirEntry))
    cr.ui.contextMenuHandler.setContextMenu(item, tree.contextMenuForSubitems);

  // Populates children now if needed.
  if (parentDirItem.expanded)
    item.updateSubDirectories(false /* recursive */);

  return item;
}
/**
 * A sub directory in the tree. Each element represents a directory which is not
 * a volume's root.
 *
 * @param {string} label Label for this item.
 * @param {DirectoryEntry} dirEntry DirectoryEntry of this item.
 * @param {DirectoryItem|ShortcutItem|DirectoryTree} parentDirItem
 *     Parent of this item.
 * @param {DirectoryTree} tree Current tree, which contains this item.
 * @extends {DirectoryItem}
 * @constructor
 */
A sub directory in the tree. Each element represents a directory which is not
a volume's root.

@param {string} label Label for this item.
@param {DirectoryEntry} dirEntry DirectoryEntry of this item.
A sub directory in the tree . Each element represents a directory which is not a volume ' s root . @param { string } label Label for this item . @param { DirectoryEntry } dirEntry DirectoryEntry of this item .
function SubDirectoryItem(label, dirEntry, parentDirItem, tree) {
  var item = new DirectoryItem(label, tree);
  item.__proto__ = SubDirectoryItem.prototype;
  item.entry = dirEntry;
  item.delayExpansion = parentDirItem.delayExpansion;
  if (item.delayExpansion) {
    item.clearHasChildren();
    item.mayHaveChildren_ = true;
  }
  var icon = item.querySelector('.icon');
  icon.classList.add('item-icon');
  var location = tree.volumeManager.getLocationInfo(item.entry);
  if (location && location.rootType && location.isRootEntry) {
    icon.setAttribute('volume-type-icon', location.rootType);
  } else {
    icon.setAttribute('file-type-icon', 'folder');
    item.updateSharedStatusIcon();
  }
  if (tree.contextMenuForSubitems && !util.isTeamDriveRoot(dirEntry))
    cr.ui.contextMenuHandler.setContextMenu(item, tree.contextMenuForSubitems);
  if (parentDirItem.expanded)
    item.updateSubDirectories(false );
  return item;
}
function SubDirectoryItem ( label , dirEntry , parentDirItem , tree ) { var item = new DirectoryItem ( label , tree ) ; item . __proto__ = SubDirectoryItem . prototype ; item . entry = dirEntry ; item . delayExpansion = parentDirItem . delayExpansion ; if ( item . delayExpansion ) { item . clearHasChildren ( ) ; item . mayHaveChildren_ = true ; } var icon = item . querySelector ( '.icon' ) ; icon . classList . add ( 'item-icon' ) ; var location = tree . volumeManager . getLocationInfo ( item . entry ) ; if ( location && location . rootType && location . isRootEntry ) { icon . setAttribute ( 'volume-type-icon' , location . rootType ) ; } else { icon . setAttribute ( 'file-type-icon' , 'folder' ) ; item . updateSharedStatusIcon ( ) ; } if ( tree . contextMenuForSubitems && ! util . isTeamDriveRoot ( dirEntry ) ) cr . ui . contextMenuHandler . setContextMenu ( item , tree . contextMenuForSubitems ) ; if ( parentDirItem . expanded ) item . updateSubDirectories ( false ) ; return item ; }
A sub directory in the tree.
A sub directory in the tree .
// Sets up icons of the item. // Sets up context menu of the item. // Populates children now if needed. /* recursive */