2016-09-10 19:29:23 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ngdoc function
|
|
|
|
* @name passmanApp.controller:MainCtrl
|
|
|
|
* @description
|
|
|
|
* # MainCtrl
|
|
|
|
* Controller of the passmanApp
|
|
|
|
*/
|
|
|
|
angular.module('passmanApp')
|
2016-10-01 04:31:46 +08:00
|
|
|
.controller('MainCtrl', ['$scope', '$rootScope', '$location', function ($scope, $rootScope, $location) {
|
2016-09-11 05:30:17 +08:00
|
|
|
$scope.selectedVault = false;
|
2016-09-23 18:30:50 +08:00
|
|
|
|
2016-10-01 04:31:46 +08:00
|
|
|
$scope.http_warning_hidden = true;
|
|
|
|
if($location.$$protocol === 'http'){
|
|
|
|
$scope.using_http = true;
|
|
|
|
$scope.http_warning_hidden = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$rootScope.setHttpWarning = function(state){
|
|
|
|
$scope.http_warning_hidden = state;
|
|
|
|
};
|
|
|
|
|
2016-09-15 05:46:48 +08:00
|
|
|
$rootScope.$on('app_menu', function(evt, shown){
|
|
|
|
$scope.app_sidebar = shown;
|
2016-09-23 18:30:50 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
$rootScope.$on('logout', function () {
|
|
|
|
$scope.selectedVault = false;
|
2016-09-15 05:46:48 +08:00
|
|
|
})
|
2016-09-11 05:30:17 +08:00
|
|
|
}]);
|
2016-09-23 18:30:50 +08:00
|
|
|
|