diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-08-24 14:55:17 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-08-26 11:30:04 +0200 |
commit | 69d2d0178a46b72bea2d4618bbd2f42456b9e761 (patch) | |
tree | 8df7cdd05f32a9da3e87f06e0617d31d60678073 | |
parent | ca490bafb950b9d16ab4543ae810c3a67cb84d5b (diff) | |
download | nextcloud-server-69d2d0178a46b72bea2d4618bbd2f42456b9e761.tar.gz nextcloud-server-69d2d0178a46b72bea2d4618bbd2f42456b9e761.zip |
Don't try the actual file upload if the checks already error out
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | apps/files/js/file-upload.js | 3 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 1 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 1f99d561a13..b86b42bdb9a 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1113,6 +1113,9 @@ OC.Uploader.prototype = _.extend({ }); fileupload.on('fileuploaddrop', function(e, data) { self.trigger('drop', e, data); + if (e.isPropagationStopped()) { + return false; + } }); } diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 9bf25c5904d..79ec8e2d9f9 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2795,6 +2795,7 @@ var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0; if (!isCreatable) { self._showPermissionDeniedNotification(); + e.stopPropagation(); return false; } diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 41d202e9323..a12c0ff49b6 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2810,6 +2810,8 @@ describe('OCA.Files.FileList tests', function() { target: $target }, preventDefault: function () { + }, + stopPropagation: function() { } }; uploader.trigger('drop', eventData, data || {}); |