diff options
author | Azul <azul@riseup.net> | 2020-04-06 09:41:36 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-04-08 18:19:58 +0200 |
commit | d2728cbdc13e89f11dc2b8c48b6148d6e89d0c83 (patch) | |
tree | 38decca5dc041c9f31d2233f4b6d13cd87549d9c /apps/files/js/filelist.js | |
parent | cb2b38516f2a5e98400e5ed2cbcd17ceeb269b9b (diff) | |
download | nextcloud-server-d2728cbdc13e89f11dc2b8c48b6148d6e89d0c83.tar.gz nextcloud-server-d2728cbdc13e89f11dc2b8c48b6148d6e89d0c83.zip |
refactor: fileActions.getCurrentDefaultFileAction()
fileActions.getCurrentDefaultFileAction() returns the default file action
for the currently selected file.
There were a number of places querying for the mime, type and permissions
of that file first to then query for the default action.
Signed-off-by: Azul <azul@riseup.net>
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 9973c92c8ec..ce428064337 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -892,13 +892,10 @@ event.preventDefault(); } else if (!renaming) { this.fileActions.currentFile = $tr.find('td'); - var mime = this.fileActions.getCurrentMimeType(); - var type = this.fileActions.getCurrentType(); - var permissions = this.fileActions.getCurrentPermissions(); - var action = this.fileActions.getDefault(mime,type, permissions); - if (action) { + var spec = this.fileActions.getCurrentDefaultFileAction(); + if (spec && spec.action) { event.preventDefault(); - action(filename, { + spec.action(filename, { $file: $tr, fileList: this, fileActions: this.fileActions, |