This commit is contained in:
Narciso Jaramillo 2012-09-13 17:34:35 -07:00
Родитель 75bb4b07dd
Коммит c137309aad
1 изменённых файлов: 18 добавлений и 10 удалений

Просмотреть файл

@ -77,6 +77,14 @@ define(function (require, exports, module) {
*/ */
var _projectTree = null; var _projectTree = null;
function canonicalize(path) {
if (path.length > 0 && path[path.length - 1] === "/") {
return path.slice(0, -1);
} else {
return path;
}
}
/** /**
* @private * @private
* Reference to previous selected jstree leaf node when ProjectManager had * Reference to previous selected jstree leaf node when ProjectManager had
@ -264,7 +272,7 @@ define(function (require, exports, module) {
fullPath = entry.fullPath; fullPath = entry.fullPath;
// Truncate project path prefix, remove the trailing slash // Truncate project path prefix, remove the trailing slash
shortPath = FileUtils.canonicalizeFolderPath(fullPath); shortPath = fullPath.slice(projectPathLength, -1);
// Determine depth of the node by counting path separators. // Determine depth of the node by counting path separators.
// Children at the root have depth of zero // Children at the root have depth of zero
@ -998,15 +1006,15 @@ define(function (require, exports, module) {
CommandManager.register(Strings.CMD_OPEN_FOLDER, Commands.FILE_OPEN_FOLDER, openProject); CommandManager.register(Strings.CMD_OPEN_FOLDER, Commands.FILE_OPEN_FOLDER, openProject);
// Define public API // Define public API
exports.getProjectRoot = getProjectRoot; exports.getProjectRoot = getProjectRoot;
exports.isWithinProject = isWithinProject; exports.isWithinProject = isWithinProject;
exports.makeProjectRelativeIfPossible = makeProjectRelativeIfPossible; exports.makeProjectRelativeIfPossible = makeProjectRelativeIfPossible;
exports.shouldShow = shouldShow; exports.shouldShow = shouldShow;
exports.openProject = openProject; exports.openProject = openProject;
exports.getSelectedItem = getSelectedItem; exports.getSelectedItem = getSelectedItem;
exports.getInitialProjectPath = getInitialProjectPath; exports.getInitialProjectPath = getInitialProjectPath;
exports.isWelcomeProjectPath = isWelcomeProjectPath; exports.isWelcomeProjectPath = isWelcomeProjectPath;
exports.updateWelcomeProjectPath = updateWelcomeProjectPath; exports.updateWelcomeProjectPath = updateWelcomeProjectPath;
exports.createNewItem = createNewItem; exports.createNewItem = createNewItem;
exports.forceFinishRename = forceFinishRename; exports.forceFinishRename = forceFinishRename;
}); });