Job detail page refactor

Exploring was to make the DOM update less CPU intensive.
This commit is contained in:
Chris Houseknecht
2014-06-19 23:22:48 -04:00
parent 346595854c
commit ff1cce8509
2 changed files with 8 additions and 4 deletions

View File

@@ -100,13 +100,13 @@ function JobDetailController ($rootScope, $scope, $compile, $routeParams, $log,
Rest.setUrl(url);
Rest.get()
.success(function(data) {
if (data.count > 0) {
if (data.results.length > 0) {
LoadHostSummary({
scope: scope,
data: data.results[0].event_data
});
UpdateDOM({ scope: scope });
}
UpdateDOM({ scope: scope });
})
.error(function(data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',

View File

@@ -948,7 +948,9 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
result.push(scope.jobData.plays[keys[idx]]);
idx++;
}
scope.plays = result;
setTimeout(function() {
scope.$apply(function() { scope.plays = result; });
});
};
}])
@@ -970,7 +972,9 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
idx++;
}
}
scope.tasks = result;
setTimeout(function() {
scope.$apply(function() { scope.tasks = result; });
});
};
}])