File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -326,17 +326,18 @@ export default {
326326 subscribe (' files:sidebar:opened' , this .handleAppSidebarOpen )
327327 subscribe (' files:sidebar:closed' , this .handleAppSidebarClose )
328328 window .addEventListener (' keydown' , this .keyboardDeleteFile )
329+ window .addEventListener (' keydown' , this .keyboardDownloadFile )
329330 },
330331
331332 beforeDestroy () {
332333 window .removeEventListener (' resize' , this .onResize )
333334 window .removeEventListener (' keydown' , this .keyboardDeleteFile )
335+ window .removeEventListener (' keydown' , this .keyboardDownloadFile )
334336 },
335337
336338 destroyed () {
337339 // Unsubscribe to Files' Sidebar events.
338340 unsubscribe (' files:sidebar:opened' , this .handleAppSidebarOpen )
339- unsubscribe (' files:sidebar:closed' , this .handleAppSidebarClose )
340341 },
341342
342343 methods: {
@@ -655,6 +656,15 @@ export default {
655656 }
656657 },
657658
659+ keyboardDownloadFile(event) {
660+ if (event.key === 'd' && event.ctrlKey === true) {
661+ event.preventDefault()
662+ if (this.canDownload) {
663+ // TODO (trigger the download, see line 53 and below
664+ }
665+ }
666+ },
667+
658668 cleanup() {
659669 // reset all properties
660670 this.currentFile = {}
You can’t perform that action at this time.
0 commit comments