From 95310c88ae6d97c2fad1c0b5bff105fd8813734b Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Tue, 2 Sep 2014 12:47:51 +0200 Subject: [PATCH 1/2] Forbid to open details if they are not open already --- .../controllers/work-packages-list-controller.js | 6 ++++-- .../directives/work-packages-table-directive.js | 2 +- public/templates/work_packages.list.html | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) 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..42ba23fe82 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 @@ -137,7 +137,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)">
From 967c261acf02e873d59724c5ac954886498a11de Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Tue, 2 Sep 2014 12:48:21 +0200 Subject: [PATCH 2/2] Change details pane selection on single-click --- .../work_packages/directives/work-packages-table-directive.js | 2 ++ 1 file changed, 2 insertions(+) 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 42ba23fe82..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 }); } } };