Skip to content

Commit d4d9e26

Browse files
author
minjk-bl
committed
Fix FileNavigation
1 parent e950555 commit d4d9e26

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

js/com/component/FileNavigation.js

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ define([
222222

223223
that.getFileList(dirObj);
224224
} else {
225-
let dirPath = that.makeNewCurrRelativePath();
225+
let dirPath = that.getRelativePath(that.pathState.baseDir, that.pathState.currentPath);
226226
let extension = name.substring(name.lastIndexOf('.') + 1);
227227
let allowExtensionList = that.state.extensions;
228228
// if it is not allowed extension
@@ -642,49 +642,6 @@ define([
642642
}
643643
}
644644

645-
/**
646-
* Make relative path using current path
647-
* @returns
648-
*/
649-
makeNewCurrRelativePath() {
650-
var pathState = this.pathState;
651-
var dirPath = pathState.relativeDir;
652-
/**
653-
* current path on opening file navigation
654-
* ex) if current path is 'C:/Users/VP/Desktop/Test'
655-
* baseFolder = 'Test'
656-
*/
657-
var baseFolder = pathState.baseFolder;
658-
/**
659-
* base folder for jupyter notebook
660-
* ex) if current path is 'C:/Users/VP/Desktop/Test'
661-
* Jupyter.notebook.notebook_path = 'Desktop/Test/Untitled.ipynb'
662-
* notebookFolder = 'Desktop'
663-
*/
664-
var noteBookFolder = pathState.notebookFolder;
665-
666-
667-
/** if baseFolder is included in current relative path */
668-
if (dirPath.indexOf(baseFolder) !== -1) {
669-
var baseFolderIndex = dirPath.indexOf(baseFolder);
670-
dirPath = dirPath.substring(baseFolderIndex,dirPath.length);
671-
dirPath = dirPath.replace(baseFolder, '');
672-
}
673-
674-
/**
675-
* if baseFolder is same with noteBookFolder,
676-
* not replacing notebookFolder inside dirPath
677-
* */
678-
if (baseFolder !== noteBookFolder) {
679-
dirPath = dirPath.replace(noteBookFolder, '');
680-
}
681-
682-
if (dirPath[0] === '/') {
683-
dirPath = dirPath.substring(1, dirPath.length);
684-
}
685-
return dirPath;
686-
}
687-
688645
splitPathStrAndSetStack(dirObj, resultInfoArr){
689646
var currentDirStr = resultInfoArr[0].current.split('//').join('/');
690647
var splitedDirStrArr = currentDirStr.split('/');

0 commit comments

Comments
 (0)