diff --git a/app/assets/javascripts/angular/work_packages/controllers/work-packages-list-controller.js b/app/assets/javascripts/angular/work_packages/controllers/work-packages-list-controller.js index 9b99e473fb..ccefe6f8e4 100644 --- a/app/assets/javascripts/angular/work_packages/controllers/work-packages-list-controller.js +++ b/app/assets/javascripts/angular/work_packages/controllers/work-packages-list-controller.js @@ -272,7 +272,9 @@ angular.module('openproject.workPackages.controllers') $state.go(latestTab.getStateName(), { workPackageId: $scope.preselectedWorkPackageId }); }; - $scope.showWorkPackageDetails = function(id) { - $state.go(latestTab.getStateName(), { workPackageId: id }); + $scope.showWorkPackageDetails = function(id, force) { + if (force || $state.current.controller == "DetailsTabOverviewController") { + $state.go(latestTab.getStateName(), { workPackageId: id }); + } }; }]); 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 15289a1ae6..a015b27cab 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 @@ -126,6 +126,8 @@ angular.module('openproject.workPackages.directives') activeSelectionBorderIndex = WorkPackagesTableService.selectRowRange(scope.rows, row, activeSelectionBorderIndex); } else { setRowSelectionState(row, !currentRowCheckState); + + scope.activationCallback({ id: row.object.id, force: false }); } } }; @@ -137,7 +139,7 @@ angular.module('openproject.workPackages.directives') setRowSelectionState(row, true); - scope.activationCallback({ id: row.object.id }); + scope.activationCallback({ id: row.object.id, force: true }); }; } }; diff --git a/public/templates/work_packages.list.html b/public/templates/work_packages.list.html index e3661f6e33..cf8b0afbb6 100644 --- a/public/templates/work_packages.list.html +++ b/public/templates/work_packages.list.html @@ -132,7 +132,7 @@ display-sums="query.displaySums" total-sums="totalSums" group-sums="groupSums" - activation-callback="showWorkPackageDetails(id)"> + activation-callback="showWorkPackageDetails(id, force)">