Completed
Push — phpunit ( 7f2080...75f541 )
by Marcos
14:28 queued 10:45
created

angular.controller(ꞌMainCtrlꞌ)   B

Complexity

Conditions 4
Paths 2

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
nc 2
nop 3
dl 0
loc 22
rs 8.9197
c 0
b 0
f 0
1
(function () {
2
	'use strict';
3
4
	/**
5
	 * @ngdoc function
6
	 * @name passmanApp.controller:MainCtrl
7
	 * @description
8
	 * # MainCtrl
9
	 * Controller of the passmanApp
10
	 */
11
	angular.module('passmanApp')
12
		.controller('MainCtrl', ['$scope', '$rootScope', '$location', function ($scope, $rootScope, $location) {
13
			$scope.selectedVault = false;
14
15
			$scope.http_warning_hidden = true;
16
			if ($location.$$protocol === 'http' && $location.$$host !== 'localhost' && $location.$host !== '127.0.0.1') {
17
				$scope.using_http = true;
18
				$scope.http_warning_hidden = false;
19
20
			}
21
22
			$rootScope.setHttpWarning = function (state) {
23
				$scope.http_warning_hidden = state;
24
			};
25
26
			$rootScope.$on('app_menu', function (evt, shown) {
27
				$scope.app_sidebar = shown;
28
			});
29
30
			$rootScope.$on('logout', function () {
31
				$scope.selectedVault = false;
32
			});
33
		}]);
34
35
}());