Don't try the actual file upload if the checks already error out

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/6252/head
Roeland Jago Douma 8 years ago committed by Morris Jobke
parent ca490bafb9
commit 69d2d0178a
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
  1. 3
      apps/files/js/file-upload.js
  2. 1
      apps/files/js/filelist.js
  3. 2
      apps/files/tests/js/filelistSpec.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;
}
});
}

@ -2795,6 +2795,7 @@
var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0;
if (!isCreatable) {
self._showPermissionDeniedNotification();
e.stopPropagation();
return false;
}

@ -2810,6 +2810,8 @@ describe('OCA.Files.FileList tests', function() {
target: $target
},
preventDefault: function () {
},
stopPropagation: function() {
}
};
uploader.trigger('drop', eventData, data || {});

Loading…
Cancel
Save