From 99b662ec5209ba9cd27364481479857b20937b15 Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Thu, 14 Aug 2014 15:38:32 +0200 Subject: [PATCH] Only select right clicked WP row --- .../angular/services/work-packages-table-service.js | 5 +++++ .../directives/work-packages-table-directive.js | 4 +--- .../angular/work_packages/work-package-context-menu.js | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/angular/services/work-packages-table-service.js b/app/assets/javascripts/angular/services/work-packages-table-service.js index 3d89cb7829..d6c2ad811d 100644 --- a/app/assets/javascripts/angular/services/work-packages-table-service.js +++ b/app/assets/javascripts/angular/services/work-packages-table-service.js @@ -131,6 +131,11 @@ angular.module('openproject.workPackages.services') }); }, + setCheckedStateForAllRows: function(rows, state) { + angular.forEach(rows, function(row) { + row.checked = state; + }); + }, setRowSelection: function(row, state) { row.checked = state; }, diff --git a/app/assets/javascripts/angular/work_packages/directives/work-packages-table-directive.js b/app/assets/javascripts/angular/work_packages/directives/work-packages-table-directive.js index 86e393ff95..048b54a9e0 100644 --- a/app/assets/javascripts/angular/work_packages/directives/work-packages-table-directive.js +++ b/app/assets/javascripts/angular/work_packages/directives/work-packages-table-directive.js @@ -79,9 +79,7 @@ angular.module('openproject.workPackages.directives') }); scope.setCheckedStateForAllRows = function(state) { - angular.forEach(scope.rows, function(row) { - row.checked = state; - }); + WorkPackagesTableService.setCheckedStateForAllRows(scope.rows, state); }; var groupableColumns = WorkPackagesTableService.getGroupableColumns(); diff --git a/app/assets/javascripts/angular/work_packages/work-package-context-menu.js b/app/assets/javascripts/angular/work_packages/work-package-context-menu.js index 5faa0d0bea..1f646beb5d 100644 --- a/app/assets/javascripts/angular/work_packages/work-package-context-menu.js +++ b/app/assets/javascripts/angular/work_packages/work-package-context-menu.js @@ -55,6 +55,7 @@ angular.module('openproject.workPackages') $scope.hideResourceActions = true; $scope.$watch('row', function() { + WorkPackagesTableService.setCheckedStateForAllRows($scope.rows, false); $scope.row.checked = true; $scope.permittedActions = WorkPackageContextMenuHelper.getPermittedActions(getSelectedWorkPackages()); });