1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 03:50:04 +02:00

Progress is floored now.

Tried doing upload & installation in multiple times but it looks bad because the animation is tweened.
This commit is contained in:
Gunther Brunner 2014-04-07 15:50:03 +09:00
parent be0510b93a
commit c2b4bf4a90
2 changed files with 11 additions and 23 deletions

View file

@ -98,34 +98,22 @@ module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettex
return false
}
$scope.taskProgressMax = function () {
return $scope.taskProgressMaxDivisor() * 100
}
$scope.taskProgressMaxDivisor = function () {
if ($scope.installEnabled) {
return 2
} else {
return 1
}
}
$scope.taskProgress = function () {
var progress = 0
if ($scope.installEnabled) {
var sum = 0
if ($scope.upload) {
sum += $scope.upload.progress
progress += $scope.upload.progress
}
if ($scope.installation) {
sum += $scope.installation.progress
progress += $scope.installation.progress
}
return sum
progress = Math.floor(progress / 2)
} else {
if ($scope.upload) {
return $scope.upload.progress
progress = $scope.upload.progress
}
}
return 0
return progress
}
//