FS-7994 - Verto Communicator - Using factory for group calls in history

This commit is contained in:
Stefan Yohansson authored and root committed 2015-09-03 08:46:07 -03:00
1 parent 46c0d05216
commit faed47bb49
8 files changed
+148 -42

No files matched your search

@@ -4,8 +4,8 @@
angular
.module('vertoControllers')
.controller('MainController',
function($scope, $rootScope, $location, $modal, $timeout, verto, storage, toastr, Fullscreen, prompt) {
function($scope, $rootScope, $location, $modal, $timeout, verto, storage, CallHistory, toastr, Fullscreen, prompt) {
console.debug('Executing MainController.');
var myVideo = document.getElementById("webcam");
@@ -140,7 +140,7 @@
);
};
$scope.openModal = function(templateUrl, controller) {
$rootScope.openModal = function(templateUrl, controller) {
var modalInstance = $modal.open({
animation: $scope.animationsEnabled,
templateUrl: templateUrl,
@@ -201,10 +201,6 @@
$scope.call_history = angular.element("#call_history").hasClass('active');
};
$scope.clearCallHistory = function() {
storage.data.call_history = [];
};
$scope.toggleChat = function() {
if ($scope.chatStatus && $rootScope.activePane === 'chat') {
$rootScope.chat_counter = 0;
@@ -328,22 +324,11 @@
$scope.answerCall();
storage.data.called_number = data;
storage.data.call_history.unshift({
'number': data,
'direction': 'inbound',
'status': true,
'call_start': Date()
});
CallHistory.add(number, 'inbound', true);
$location.path('/incall');
}, function() {
$scope.declineCall();
storage.data.call_history.unshift({
'number': data,
'direction': 'inbound',
'status': false,
'call_start': Date()
});
CallHistory.add(number, 'inbound', false);
});
});
@@ -439,4 +424,4 @@
}
);
})();
})();