passman/js/app/controllers/main.js

34 lines
729 B
JavaScript
Raw Normal View History

'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;
};
$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-11 05:30:17 +08:00
}]);
2016-09-23 18:30:50 +08:00