Trigger download from fileactions if no default action is found

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-02-06 14:16:39 +01:00
parent 0df5110127
commit 1c5c44be3f
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 4 additions and 0 deletions

View File

@ -829,6 +829,10 @@
var type = this.fileActions.getCurrentType(); var type = this.fileActions.getCurrentType();
var permissions = this.fileActions.getCurrentPermissions(); var permissions = this.fileActions.getCurrentPermissions();
var action = this.fileActions.getDefault(mime,type, permissions); var action = this.fileActions.getDefault(mime,type, permissions);
if (typeof action === 'undefined' && type === 'file') {
var actions = this.fileActions.get(mime,type, permissions);
action = actions['Download'];
}
if (action) { if (action) {
event.preventDefault(); event.preventDefault();
// also set on global object for legacy apps // also set on global object for legacy apps