Make group expansion toggle for all groups do something

pull/913/head
Till Breuer 11 years ago
parent 79e933dcd8
commit decf82879a
  1. 8
      app/assets/javascripts/angular/directives/work_packages/work-package-group-header.js
  2. 4
      public/templates/work_packages/work_packages_table.html

@ -12,6 +12,14 @@ angular.module('openproject.workPackages.directives')
pushGroup(scope.currentGroup); pushGroup(scope.currentGroup);
scope.toggleAllGroups = function() {
var targetExpansion = !scope.groupExpanded[scope.currentGroup];
angular.forEach(scope.groupExpanded, function(currentExpansion, group) {
scope.groupExpanded[group] = targetExpansion;
});
};
function pushGroup(group) { function pushGroup(group) {
if (scope.groupExpanded[group] === undefined) { if (scope.groupExpanded[group] === undefined) {
scope.groupExpanded[group] = true; scope.groupExpanded[group] = true;

@ -51,7 +51,9 @@
{{ work_package_count_for((row.object | columnContent:groupBy)) }} {{ work_package_count_for((row.object | columnContent:groupBy)) }}
<span aria-hidden="true" role="presentation" tabindex="-1"> <span aria-hidden="true" role="presentation" tabindex="-1">
<a class="toggle-all" href="#" onclick="toggleAllRowGroups(this); return false;">{{ I18n.t('js.label_collapse_all') }}</a> <a class="toggle-all" ng-href="#" ng-click="toggleAllGroups()">
{{ groupExpanded[currentGroup] && I18n.t('js.label_collapse_all') || I18n.t('js.label_expand_all') }}
</a>
</span> </span>
</span> </span>
</span> </span>

Loading…
Cancel
Save