mirror of https://github.com/BTCPrivate/copay.git
44 lines
910 B
JavaScript
44 lines
910 B
JavaScript
'use strict';
|
|
|
|
angular.module('copay.header').controller('HeaderController',
|
|
function($scope, $rootScope, $location, Network) {
|
|
$scope.menu = [{
|
|
'title': 'Home',
|
|
'link': '#/home'
|
|
}, {
|
|
'title': 'Transactions',
|
|
'link': '#/transactions'
|
|
}, {
|
|
'title': 'Send',
|
|
'link': '#/send'
|
|
}, {
|
|
'title': 'Backup',
|
|
'link': '#/backup'
|
|
}];
|
|
|
|
if (!$rootScope.peerId) {
|
|
$location.path('signin');
|
|
}
|
|
|
|
$scope.isActive = function(item) {
|
|
if (item.link.replace('#','') == $location.path()) {
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
|
|
$scope.init = function() {
|
|
$rootScope.isLogged = false;
|
|
};
|
|
|
|
$scope.signout = function() {
|
|
Network.disconnect(function() {
|
|
$location.path('signin');
|
|
});
|
|
};
|
|
|
|
$scope.clearFlashMessage = function() {
|
|
$rootScope.flashMessage = {};
|
|
};
|
|
});
|