[directory tree] Add TreeItem class
Reading the directory-tree.js I see the following in a few tree item classes derived from cr.ui.TreeItem: // Get the original label id defined by TreeItem before overwriting // prototype. followed by identical code to label the derived cr.ui.TreeItem By the time I'd read that 3 times I imagine we could improve the our code health by ditching this clearly duplicated code. Begin with a simple idea class TreeItem: a TreeItem that has a label and createRowElementContent() helpers, used to provide the innerHTML row content depending on mode FILES_NG_ENABLED or not. In subsequent patches, we will use this class to label all tree item classes derived from cr.ui.TreeItem, and shave off code lines. Bug: 992819 Change-Id: I30867c20c80e000f7175aaaaf1bc3bf212ae6bfa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1866122Reviewed-by:Austin Tankiang <austinct@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#707215}
Showing
Please register or sign in to comment