File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,20 @@ export function initRepoEditor() {
75
75
}
76
76
filenameInput . addEventListener ( 'input' , function ( ) {
77
77
const parts = filenameInput . value . split ( '/' ) ;
78
+ const links = document . querySelectorAll ( '.breadcrumb span.section' ) ;
79
+ const dividers = document . querySelectorAll ( '.breadcrumb-divider' ) ;
78
80
if ( parts . length > 1 ) {
79
81
let containSpace = false ;
80
82
for ( let i = 0 ; i < parts . length ; ++ i ) {
81
83
const value = parts [ i ] ;
84
+ if ( value . trim ( ) === '..' ) {
85
+ // remove previous tree path
86
+ if ( links . length > 0 ) {
87
+ links [ links . length - 1 ] . remove ( ) ;
88
+ dividers [ dividers . length - 1 ] . remove ( ) ;
89
+ }
90
+ continue ;
91
+ }
82
92
if ( i < parts . length - 1 ) {
83
93
if ( value . length ) {
84
94
$ ( `<span class="section"><a href="#">${ htmlEscape ( value ) } </a></span>` ) . insertBefore ( $ ( filenameInput ) ) ;
You can’t perform that action at this time.
0 commit comments