use jqXHR.fail() to check for failures
Signed-off-by: Artur Neumann <info@individual-it.net>
This commit is contained in:
parent
4dab01d9ed
commit
79c760a10c
|
@ -90,16 +90,15 @@
|
||||||
},
|
},
|
||||||
done: function(e, data) {
|
done: function(e, data) {
|
||||||
// Created
|
// Created
|
||||||
if (data.jqXHR.status === 201) {
|
var mimeTypeUrl = OC.MimeType.getIconUrl(data.files[0].type);
|
||||||
var mimeTypeUrl = OC.MimeType.getIconUrl(data.files[0].type);
|
$('#public-upload ul li[data-name="' + escapeHTML(data.files[0].name) + '"]').html('<img src="' + escapeHTML(mimeTypeUrl) + '"/> ' + escapeHTML(data.files[0].name));
|
||||||
$('#public-upload ul li[data-name="' + escapeHTML(data.files[0].name) + '"]').html('<img src="' + escapeHTML(mimeTypeUrl) + '"/> ' + escapeHTML(data.files[0].name));
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
},
|
||||||
} else {
|
fail: function(e, data, errorThrown) {
|
||||||
var name = data.files[0].name;
|
var name = data.files[0].name;
|
||||||
OC.Notification.showTemporary(OC.L10N.translate('files_sharing', 'Could not upload "{filename}"', {filename: name}));
|
OC.Notification.showTemporary(OC.L10N.translate('files_sharing', 'Could not upload "{filename}"', {filename: name}));
|
||||||
$('#public-upload ul li[data-name="' + escapeHTML(name) + '"]').html(output({isUploading: false, name: escapeHTML(name)}));
|
$('#public-upload ul li[data-name="' + escapeHTML(name) + '"]').html(output({isUploading: false, name: escapeHTML(name)}));
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
}
|
|
||||||
},
|
},
|
||||||
progressall: function (e, data) {
|
progressall: function (e, data) {
|
||||||
var progress = parseInt(data.loaded / data.total * 100, 10);
|
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||||
|
|
Loading…
Reference in New Issue