@@ -222,7 +222,7 @@ define([
222
222
223
223
that . getFileList ( dirObj ) ;
224
224
} else {
225
- let dirPath = that . makeNewCurrRelativePath ( ) ;
225
+ let dirPath = that . getRelativePath ( that . pathState . baseDir , that . pathState . currentPath ) ;
226
226
let extension = name . substring ( name . lastIndexOf ( '.' ) + 1 ) ;
227
227
let allowExtensionList = that . state . extensions ;
228
228
// if it is not allowed extension
@@ -642,49 +642,6 @@ define([
642
642
}
643
643
}
644
644
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
-
688
645
splitPathStrAndSetStack ( dirObj , resultInfoArr ) {
689
646
var currentDirStr = resultInfoArr [ 0 ] . current . split ( '//' ) . join ( '/' ) ;
690
647
var splitedDirStrArr = currentDirStr . split ( '/' ) ;
0 commit comments