Job events now expands all parent nodes correctly or consistently.

This commit is contained in:
chouseknecht 2013-07-02 12:00:20 -04:00
parent 6e0b9a2acb
commit 507d1d06f5
2 changed files with 3 additions and 4 deletions

View File

@ -58,11 +58,10 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
if (scope.removeSetExpanded) {
scope.removeSetExpanded();
}
scope.removeSetExpanded = scope.$on('setExpanded', function(event, latest_node) {
scope.removeSetExpanded = scope.$on('setExpanded', function(event) {
// After ToggleChildren completes, look for the next parent that needs to be expanded
var found = false;
var start = (latest_node) ? latest_node : 0;
for (var i=start; i < set.length && found == false && scope.expand; i++) {
for (var i=0; i < set.length && found == false && scope.expand; i++) {
if (set[i]['related']['children'] && (set[i]['ngicon'] == undefined || set[i]['ngicon'] == 'icon-expand-alt')) {
found = true;
ToggleChildren({

View File

@ -81,7 +81,7 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
}
clicked++;
}
scope.$emit('setExpanded', clicked - 1);
scope.$emit('setExpanded');
})
.error( function(data, status, headers, config) {
ProcessErrors(scope, data, status, null,