let the upload notification stick for a couple of seconds

Signed-off-by: Florian Kraft <f.kraft@finn.de>
pull/3245/head
Florian Kraft 9 years ago
parent 8013633a03
commit a17645b47c
  1. 1
      frontend/app/work_packages/services/index.js
  2. 8
      frontend/app/work_packages/services/work-package-attachments-service.js

@ -77,5 +77,6 @@ angular.module('openproject.workPackages.services')
'I18n',
'NotificationsService',
'$q',
'$timeout',
require('./work-package-attachments-service')
]);

@ -26,7 +26,7 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
module.exports = function(Upload, PathHelper, I18n, NotificationsService, $q) {
module.exports = function(Upload, PathHelper, I18n, NotificationsService, $q, $timeout) {
var currentUploads = [];
var upload = function(workPackage, files) {
@ -55,7 +55,11 @@ module.exports = function(Upload, PathHelper, I18n, NotificationsService, $q) {
var notification = NotificationsService.addWorkPackageUpload(message, uploads);
currentUploads.push(notification);
$q.all(uploads).then(function() { NotificationsService.remove(notification); });
$q.all(uploads).then(function() {
$timeout(function() {
NotificationsService.remove(notification);
}, 700);
});
},
getCurrentNotification = function(notification) {
return _.find(currentUploads, notification);

Loading…
Cancel
Save