summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-12-23 13:58:43 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-12-26 04:56:25 +0100
commitea40ade8adc115b45c09be0dc5148cfe2530079c (patch)
tree7fc0d30806e72d2e371eb8d86e57e791fec72d35 /apps/files/js/filelist.js
parente37fa60784f94abb6715704ffcbd479c05938e3a (diff)
downloadnextcloud-server-ea40ade8adc115b45c09be0dc5148cfe2530079c.tar.gz
nextcloud-server-ea40ade8adc115b45c09be0dc5148cfe2530079c.zip
Fix "fileActions.currentFile" not set before using it
When an empty area of a file row was clicked and the "Details" action was executed "fileActions.currentFile" was not guaranteed to be set to the appropriate object (it depended on the previous actions of the user), so when it was used by "getCurrentMimeType()" and other FileActions functions they may not work as expected. Now it is explicitly set to the appropriate value before its use. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 7735e9357b1..b67bafb2349 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -683,11 +683,14 @@
// the details to be shown.
event.preventDefault();
var filename = $tr.attr('data-file');
+ 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.get(mime, type, permissions)['Details'];
if (action) {
+ // also set on global object for legacy apps
+ window.FileActions.currentFile = this.fileActions.currentFile;
action(filename, {
$file: $tr,
fileList: this,