function DirectoryItem(label, tree) {
  var item = /** @type {DirectoryItem} */ (new cr.ui.TreeItem());
  // Get the original label id defined by TreeItem, before overwriting
  // prototype.
  var labelId = item.labelElement.id;
  item.__proto__ = DirectoryItem.prototype;
  item.parentTree_ = tree;
  item.directoryModel_ = tree.directoryModel;
  item.fileFilter_ = tree.directoryModel.getFileFilter();

  item.innerHTML = TREE_ITEM_INNER_HTML;
  item.labelElement.id = labelId;
  item.addEventListener('expand', item.onExpand_.bind(item), false);

  // Listen for collapse because for the delayed expansion case all
  // children are also collapsed.
  item.addEventListener('collapse', item.onCollapse_.bind(item), false);

  // Default delayExpansion to false. Volumes will set it to true for
  // provided file systems. SubDirectories will inherit from their
  // parent.
  item.delayExpansion = false;

  // Sets hasChildren=false tentatively. This will be overridden after
  // scanning sub-directories in updateSubElementsFromList().
  item.hasChildren = false;

  item.label = label;

  return item;
}
/**
 * An expandable directory in the tree. Each element represents one folder (sub
 * directory) or one volume (root directory).
 *
 * @param {string} label Label for this item.
 * @param {DirectoryTree} tree Current tree, which contains this item.
 * @extends {cr.ui.TreeItem}
 * @constructor
 */
An expandable directory in the tree. Each element represents one folder (sub
directory) or one volume (root directory).

@param {string} label Label for this item.
@param {DirectoryTree} tree Current tree, which contains this item.
An expandable directory in the tree . Each element represents one folder ( sub directory ) or one volume ( root directory ) . @param { string } label Label for this item . @param { DirectoryTree } tree Current tree which contains this item .
function DirectoryItem(label, tree) {
  var item =  (new cr.ui.TreeItem());
  var labelId = item.labelElement.id;
  item.__proto__ = DirectoryItem.prototype;
  item.parentTree_ = tree;
  item.directoryModel_ = tree.directoryModel;
  item.fileFilter_ = tree.directoryModel.getFileFilter();
  item.innerHTML = TREE_ITEM_INNER_HTML;
  item.labelElement.id = labelId;
  item.addEventListener('expand', item.onExpand_.bind(item), false);
  item.addEventListener('collapse', item.onCollapse_.bind(item), false);
  item.delayExpansion = false;
  item.hasChildren = false;
  item.label = label;
  return item;
}
function DirectoryItem ( label , tree ) { var item = ( new cr . ui . TreeItem ( ) ) ; var labelId = item . labelElement . id ; item . __proto__ = DirectoryItem . prototype ; item . parentTree_ = tree ; item . directoryModel_ = tree . directoryModel ; item . fileFilter_ = tree . directoryModel . getFileFilter ( ) ; item . innerHTML = TREE_ITEM_INNER_HTML ; item . labelElement . id = labelId ; item . addEventListener ( 'expand' , item . onExpand_ . bind ( item ) , false ) ; item . addEventListener ( 'collapse' , item . onCollapse_ . bind ( item ) , false ) ; item . delayExpansion = false ; item . hasChildren = false ; item . label = label ; return item ; }
An expandable directory in the tree.
An expandable directory in the tree .
/** @type {DirectoryItem} */ // Get the original label id defined by TreeItem, before overwriting // prototype. // Listen for collapse because for the delayed expansion case all // children are also collapsed. // Default delayExpansion to false. Volumes will set it to true for // provided file systems. SubDirectories will inherit from their // parent. // Sets hasChildren=false tentatively. This will be overridden after // scanning sub-directories in updateSubElementsFromList().