file menu: allow mod keys

Massimo Melina committed Mar 26, 2023 at 18:24 UTC 01458ecd8618548a7ecbcbe1ddbc3497dccd8b83
1 file changed +6 -5
frontend/src/BrowseFiles.ts
+6 -5
@@ -206,10 +206,9 @@ const Entry = memo((entry: DirEntry & { midnight: Date, separator?: string }) =>
206 containerDir && h(Link, { to: base+fixUrl(containerDir), className:'container-folder' }, ico, containerDir ),
207 h('a', {
208 href,
209 - onClick(ev: Event) {
210 - if (!menuOnLink) return
211 - ev.preventDefault()
212 - openFileMenu(ev)
209 + onClick(ev: MouseEvent) {
210 + if (menuOnLink)
211 + openFileMenu(ev)
212 }
213 }, !containerDir && ico, name)
214 ),
@@ -221,7 +220,9 @@ const Entry = memo((entry: DirEntry & { midnight: Date, separator?: string }) =>
220 h('div'),
221 )
222
224 - function openFileMenu(ev: Event) {
223 + function openFileMenu(ev: MouseEvent) {
224 + if (ev.altKey || ev.ctrlKey || ev.metaKey) return
225 + ev.preventDefault()
226 const menu = [
227 menuOnLink && { label: "Open", href, target: '_blank', icon: 'play' },
228 { label: "Download", href: href + '?dl', icon: 'download' },