Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix issue #149 #262

Merged
merged 11 commits into from
Feb 17, 2012
Merged

Fix issue #149 #262

merged 11 commits into from
Feb 17, 2012

Conversation

jasonsanjose
Copy link
Member

@joelrbrandt

Use an empty child list instead of placeholder child data when the directory is empty. Since jstree treats empty directories as leaves, manually manage styles when necessary.

Use an empty child list instead of placeholder child data when the directory is empty. Since jstree treats empty directories as leaves, manually manage styles when necessary.
@joelrbrandt
Copy link
Contributor

@jason-sanjose I'll have time to look this over this afternoon. If someone wants to take a look sooner, no worries.

if (fullPath) {
var lastChar = fullPath.length - 1;
if (isDirectory && fullPath.charAt(lastChar) === "/") {
fullPath = fullPath.substr(0, lastChar);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem to work on the mac if fullPath is "/" (which you get by opening the main system hard drive "directory"). It will change fullPath to the empty string, which (eventually) causes brackets to hard crash.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also this causes problems several lines below (in the same function) where we check a potentially empty string with "if (fullPath)". Empty strings are "falsy", so this may not be doing what we want.

Copy link
Member Author

Choose a reason for hiding this comment

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

Adding check for root dir.

@joelrbrandt
Copy link
Contributor

@jason-sanjose I looked this over. For the most part, it looks great.

However, there are a few bugs, as noted in the individual line comments. Technically, these bugs aren't a part of issue #149. But, it seems that they are introduced as a result of these changes.

Also note that I did the testing after merging in master to this branch.

@jasonsanjose
Copy link
Member Author

Ready to go again. I had to account for trailing slashes in a few more spots.

Use a placeholder item when the project root is empty. Use Entry.name for project title instead of looking for trailing slash.
@jasonsanjose
Copy link
Member Author

Also fixed the stuck "loading..." message for an empty project.

@joelrbrandt
Copy link
Contributor

Looks great, merging!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants