File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 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';
3232import { doubleTap } from '../../utils/input' ;
3333import { pathJoin } from '../../utils/vfs' ;
3434
35- // TODO: Add context menu with refresh
36-
3735const tapper = doubleTap ( ) ;
3836
3937const validVfsDrop = data => data && data . path ;
@@ -234,6 +232,8 @@ export class DesktopIconView extends EventEmitter {
234232 this . createFileContextMenu ( ev , entry ) ;
235233
236234 return { selected : index } ;
235+ } else {
236+ this . createRootContextMenu ( ev ) ;
237237 }
238238 } ,
239239
@@ -338,4 +338,16 @@ export class DesktopIconView extends EventEmitter {
338338 } ]
339339 } ) ;
340340 }
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+ }
341353}
You can’t perform that action at this time.
0 commit comments