diff --git a/src/adapters/ui/iconview.js b/src/adapters/ui/iconview.js index ea9d5396..037dec18 100644 --- a/src/adapters/ui/iconview.js +++ b/src/adapters/ui/iconview.js @@ -32,8 +32,6 @@ import {h, app} from 'hyperapp'; import {doubleTap} from '../../utils/input'; import {pathJoin} from '../../utils/vfs'; -// TODO: Add context menu with refresh - const tapper = doubleTap(); const validVfsDrop = data => data && data.path; @@ -234,6 +232,8 @@ export class DesktopIconView extends EventEmitter { this.createFileContextMenu(ev, entry); return {selected: index}; + } else { + this.createRootContextMenu(ev); } }, @@ -338,4 +338,16 @@ export class DesktopIconView extends EventEmitter { }] }); } + + createRootContextMenu(ev) { + const _ = this.core.make('osjs/locale').translate; + + this.core.make('osjs/contextmenu', { + position: ev, + menu: [{ + label: _('LBL_REFRESH'), + onclick: () => this.iconview.reload() + }] + }); + } }