Remove watcher without receiving the whole WP again

pull/1726/head
Hagen Schink 10 years ago
parent cbc4163b77
commit 79bbcc5d5b
  1. 10
      app/assets/javascripts/angular/work_packages/controllers/details-tab-watchers-controller.js

@ -103,7 +103,15 @@ angular.module('openproject.workPackages.controllers')
function deleteWatcherSuccess(watcher) {
$scope.outputMessage(I18n.t("js.label_watcher_deleted_successfully"));
$scope.refreshWorkPackage();
removeWatcherFromList(watcher);
}
function removeWatcherFromList(watcher) {
var index = $scope.watchers.indexOf(watcher);
if (index >= 0) {
$scope.watchers.splice(index, 1);
}
}
$scope.selectedWatcher = { id: null };

Loading…
Cancel
Save