Don't try the actual file upload if the checks already error out
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
2c6bc236cb
commit
99b102e15d
|
@ -1113,6 +1113,9 @@ OC.Uploader.prototype = _.extend({
|
|||
});
|
||||
fileupload.on('fileuploaddrop', function(e, data) {
|
||||
self.trigger('drop', e, data);
|
||||
if (e.isPropagationStopped()) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -2790,6 +2790,7 @@
|
|||
var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0;
|
||||
if (!isCreatable) {
|
||||
self._showPermissionDeniedNotification();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -2696,6 +2696,8 @@ describe('OCA.Files.FileList tests', function() {
|
|||
target: $target
|
||||
},
|
||||
preventDefault: function () {
|
||||
},
|
||||
stopPropagation: function() {
|
||||
}
|
||||
};
|
||||
uploader.trigger('drop', eventData, data || {});
|
||||
|
|
Loading…
Reference in New Issue