Skip to content

Commit

Permalink
Document the separator generation better.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout committed Jun 13, 2019
1 parent b2229c0 commit 2a3827f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/filebrowser/src/crumbs.ts
Expand Up @@ -370,7 +370,12 @@ namespace Private {
*/
export function createCrumbSeparators(): ReadonlyArray<HTMLElement> {
let items: HTMLElement[] = [];
for (let i = 0; i < 4; i++) {
// The maximum number of directories that will be shown in the crumbs
const MAX_DIRECTORIES = 2;

// Make separators for after each directory, one at the beginning, and one
// after a possible ellipsis.
for (let i = 0; i < MAX_DIRECTORIES + 2; i++) {
let item = document.createElement('span');
item.textContent = '/';
items.push(item);
Expand Down

1 comment on commit 2a3827f

@MichaelTiemannOSC
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting MAX_DIRECTORIES to 2 is not enough breadcrumbs for me. Why is this not a configurable parameter? How much other code in crumbs.ts breaks when this value is changed. Seems like there's a lot of hard-wired logic that assumes this number is only ever 2. Would anybody be open to a PR that makes this configurable?

Please sign in to comment.