File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ import {h, app} from 'hyperapp';
32
32
import { doubleTap } from '../../utils/input' ;
33
33
import { pathJoin } from '../../utils/vfs' ;
34
34
35
- // TODO: Add context menu with refresh
36
-
37
35
const tapper = doubleTap ( ) ;
38
36
39
37
const validVfsDrop = data => data && data . path ;
@@ -234,6 +232,8 @@ export class DesktopIconView extends EventEmitter {
234
232
this . createFileContextMenu ( ev , entry ) ;
235
233
236
234
return { selected : index } ;
235
+ } else {
236
+ this . createRootContextMenu ( ev ) ;
237
237
}
238
238
} ,
239
239
@@ -338,4 +338,16 @@ export class DesktopIconView extends EventEmitter {
338
338
} ]
339
339
} ) ;
340
340
}
341
+
342
+ createRootContextMenu ( ev ) {
343
+ const _ = this . core . make ( 'osjs/locale' ) . translate ;
344
+
345
+ this . core . make ( 'osjs/contextmenu' , {
346
+ position : ev ,
347
+ menu : [ {
348
+ label : _ ( 'LBL_REFRESH' ) ,
349
+ onclick : ( ) => this . iconview . reload ( )
350
+ } ]
351
+ } ) ;
352
+ }
341
353
}
You can’t perform that action at this time.
0 commit comments