File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -350,11 +350,13 @@ export default {
350350 subscribe (' files:sidebar:opened' , this .handleAppSidebarOpen )
351351 subscribe (' files:sidebar:closed' , this .handleAppSidebarClose )
352352 window .addEventListener (' keydown' , this .keyboardDeleteFile )
353+ window .addEventListener (' keydown' , this .keyboardDownloadFile )
353354 },
354355
355356 beforeDestroy () {
356357 window .removeEventListener (' resize' , this .onResize )
357358 window .removeEventListener (' keydown' , this .keyboardDeleteFile )
359+ window .removeEventListener (' keydown' , this .keyboardDownloadFile )
358360 },
359361
360362 destroyed () {
@@ -680,6 +682,20 @@ export default {
680682 }
681683 },
682684
685+ keyboardDownloadFile(event) {
686+ if (event.key === 's' && event.ctrlKey === true) {
687+ event.preventDefault()
688+ if (this.canDownload) {
689+ const a = document.createElement('a')
690+ a.href = this.currentFile.davPath
691+ a.download = this.currentFile.basename
692+ document.body.appendChild(a)
693+ a.click()
694+ document.body.removeChild(a)
695+ }
696+ }
697+ },
698+
683699 cleanup() {
684700 // reset all properties
685701 this.currentFile = {}
You can’t perform that action at this time.
0 commit comments