working with events
This commit is contained in:
parent
3ae6378678
commit
494c21132a
4 changed files with 26 additions and 10 deletions
|
|
@ -44,14 +44,30 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
|
|||
|
||||
|
||||
$scope.init = function() {
|
||||
|
||||
// Change focused wallet
|
||||
if ($rootScope.wallet) {
|
||||
$rootScope.$watch('wallet', function() {
|
||||
$scope.walletSelection = false;
|
||||
$scope.setWallets();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Change wallet list
|
||||
if ($rootScope.iden) {
|
||||
var iden = $rootScope.iden;
|
||||
iden.on('newWallet', function() {
|
||||
$scope.walletSelection = false;
|
||||
$scope.setWallets();
|
||||
});
|
||||
iden.on('deleteWallet', function() {
|
||||
$scope.walletSelection = false;
|
||||
$scope.setWallets();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.setWallets = function() {
|
||||
if (!$rootScope.iden) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue