FS-8966 - [verto_communicator] Ability to cancel dialing while doing speed test

This commit is contained in:
Italo Rossi
2016-03-22 16:10:11 -03:00
parent fa702f2710
commit 9ffd25e1e3
3 changed files with 24 additions and 5 deletions

View File

@@ -109,6 +109,7 @@
* Call to the number in the $rootScope.dialpadNumber.
*/
$scope.loading = false;
$scope.cancelled = false;
$rootScope.call = function(extension) {
if (!storage.data.testSpeedJoin || !$rootScope.dialpadNumber) {
return call(extension);
@@ -116,10 +117,19 @@
$scope.loading = true;
verto.testSpeed(function() {
$scope.loading = false;
call(extension);
if ($scope.cancelled) {
$scope.cancelled = false;
$scope.loading = false;
return;
} else {
call(extension);
}
});
}
$rootScope.cancel = function() {
$scope.cancelled = true;
}
}
]);