File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -218,24 +218,17 @@ export class DirTreeListing extends DirListing {
218
218
return this . _model ;
219
219
}
220
220
221
- protected handleOpen ( item : Contents . IModel ) : void {
222
- if ( item . type === 'directory' ) {
223
- this . model . toggle ( item . path ) ;
224
- } else {
225
- super . handleOpen ( item ) ;
226
- }
227
- }
228
-
229
221
protected async handleFileSelect ( event : MouseEvent ) : Promise < void > {
230
222
super . handleFileSelect ( event ) ;
231
223
232
224
if ( Object . keys ( this . selection ) . length === 1 ) {
233
225
const selection = Object . keys ( this . selection ) [ 0 ] ;
234
226
235
- const isDirectory = await this . model . isDirectory ( selection ) ;
227
+ const entry = await this . model . getEntry ( selection ) ;
236
228
237
- if ( isDirectory ) {
229
+ if ( entry . type === 'directory' ) {
238
230
this . model . path = '/' + selection ;
231
+ this . model . toggle ( entry . path ) ;
239
232
} else {
240
233
this . model . path = '/' + PathExt . dirname ( selection ) ;
241
234
}
@@ -407,10 +400,8 @@ export class FilterFileTreeBrowserModel extends FilterFileBrowserModel {
407
400
this . _path = value ;
408
401
}
409
402
410
- async isDirectory ( path : string ) : Promise < boolean > {
411
- const entry = await this . contentManager . get ( path ) ;
412
-
413
- return entry . type === 'directory' ;
403
+ async getEntry ( path : string ) : Promise < Contents . IModel > {
404
+ return await this . contentManager . get ( path ) ;
414
405
}
415
406
416
407
/**
You can’t perform that action at this time.
0 commit comments