engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum.controller.js in katello-3.9.1 vs engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum.controller.js in katello-3.10.0.rc1

- old
+ new

@@ -14,17 +14,36 @@ $scope.panel = { error: false, loading: true }; + $scope.moduleStreamShowMap = {}; + if ($scope.errata) { $scope.panel.loading = false; } $scope.errata = Erratum.get({id: $scope.$stateParams.errataId}, function () { $scope.panel.loading = false; }, function (response) { $scope.panel.loading = false; ApiErrorHandler.handleGETRequestErrors(response, $scope); }); + + $scope.showModuleStreamList = function (moduleStreamId) { + return (!$scope.moduleStreamShowMap.hasOwnProperty(moduleStreamId) || + $scope.moduleStreamShowMap[moduleStreamId]); + }; + + $scope.toggleModuleStreamList = function (moduleStreamId) { + if ($scope.moduleStreamShowMap.hasOwnProperty(moduleStreamId)) { + $scope.moduleStreamShowMap[moduleStreamId] = !$scope.moduleStreamShowMap[moduleStreamId]; + } else { + $scope.moduleStreamShowMap[moduleStreamId] = false; + } + }; + + $scope.moduleStreamChevron = function (moduleStreamId) { + return $scope.showModuleStreamList(moduleStreamId) ? 'down' : 'right'; + }; } ]);