Skip to content

Commit 4897e2a

Browse files
committed
Refactor tree
1 parent 308350a commit 4897e2a

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

.DS_Store

6 KB
Binary file not shown.

js/script.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,7 @@ function drawTree() {
147147
context.fillText(fileName, leftShift, topShift);
148148
}
149149

150-
const traverseFilesTree = (branch) => {
151-
drawFilePath(branch);
152-
if (branch.children.length) {
153-
branch.children.forEach(chiildBranch => {
154-
traverseFilesTree(chiildBranch);
155-
});
156-
}
157-
};
158-
159-
traverseFilesTree(fileNamesTree._root, 0);
150+
fileNamesTree._traverse(drawFilePath);
160151

161152
if (imageStyles.watermarkEnabled) {
162153
context.font = "12px Arial, Helvetica, sans-serif";

0 commit comments

Comments
 (0)