summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-10-12 10:54:58 +0200
committerRobin Appelman <robin@icewind.nl>2015-10-12 10:54:58 +0200
commit179c0be158a938e720713e38dfd98bcfd43c07f5 (patch)
treeb3aab6c7ad748a6e3886e63ceab7ead3284f8014 /apps/files
parente16ac12f5a9b4537c97b3fdecbdbee68e706b587 (diff)
parent8a1a1c1326ffa7cecc1a53b1e7648b060d7bfc0f (diff)
downloadnextcloud-server-179c0be158a938e720713e38dfd98bcfd43c07f5.tar.gz
nextcloud-server-179c0be158a938e720713e38dfd98bcfd43c07f5.zip
Merge pull request #19628 from owncloud/files-canceluploaddebounce
Debounce cancel upload message
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/file-upload.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 8bae8567a05..77b85ecd7da 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -75,6 +75,9 @@ OC.Upload = {
this._uploads.push(jqXHR);
}
},
+ showUploadCancelMessage: _.debounce(function() {
+ OC.Notification.showTemporary(t('files', 'Upload cancelled.'), {timeout: 10});
+ }, 500),
/**
* Checks the currently known uploads.
* returns true if any hxr has the state 'pending'
@@ -415,10 +418,10 @@ OC.Upload = {
OC.Upload.log('fail', e, data);
if (typeof data.textStatus !== 'undefined' && data.textStatus !== 'success' ) {
if (data.textStatus === 'abort') {
- OC.Notification.show(t('files', 'Upload cancelled.'));
+ OC.Upload.showUploadCancelMessage();
} else {
// HTTP connection problem
- OC.Notification.show(data.errorThrown);
+ OC.Notification.showTemporary(data.errorThrown, {timeout: 10});
if (data.result) {
var result = JSON.parse(data.result);
if (result && result[0] && result[0].data && result[0].data.code === 'targetnotfound') {
@@ -427,10 +430,6 @@ OC.Upload = {
}
}
}
- //hide notification after 10 sec
- setTimeout(function() {
- OC.Notification.hide();
- }, 10000);
}
OC.Upload.deleteUpload(data);
},