Move notifications to multi storage service

pull/3753/head
Alex Dik 9 years ago
parent f1f767fa07
commit 126e1b7964
  1. 8
      frontend/app/components/inplace-edit/services/inplace-edit-multi-storage.service.js
  2. 6
      frontend/app/components/work-packages/directives/work-package-comment/work-package-comment.directive.js

@ -41,6 +41,14 @@ function inplaceEditMultiStorage($rootScope, $q, inplaceEditStorage, EditableFie
});
});
$rootScope.$on('inplaceEditMultiStorage.save.comment', function (event, promise) {
promise.then(function() {
NotificationsService.addSuccess(I18n.t('js.work_packages.comment_added'));
}).catch(function() {
NotificationsService.addError(I18n.t('js.work_packages.comment_send_failed'));
});
});
return {
save: function () {
var promises = [];

@ -137,16 +137,12 @@ function workPackageComment($rootScope, $timeout, $location, EditableFieldsState
ctrl.startEditing(quote);
});
$rootScope.$on('inplaceEditMultiStorage.save.comment', function (event, promise) {
$scope.$on('inplaceEditMultiStorage.save.comment', function (event, promise) {
promise.then(function() {
ctrl.discardEditing();
NotificationsService.addSuccess(I18n.t('js.work_packages.comment_added'));
var nextActivity = ctrl.activities.length + 1;
$location.hash('activity-' + (nextActivity));
}).catch(function() {
NotificationsService.addError(I18n.t('js.work_packages.comment_send_failed'));
});
});
}

Loading…
Cancel
Save