implemented wallet selection in sidebar

This commit is contained in:
Ivan Socolsky 2014-10-16 12:48:47 -03:00 committed by Matias Alejo Garcia
commit 62502bc698
2 changed files with 29 additions and 22 deletions

View file

@ -78,6 +78,10 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
} }
$scope.switchWallet = function(wid) { $scope.switchWallet = function(wid) {
$scope.walletSelection = false;
controllerUtils.setFocusedWallet(wid); controllerUtils.setFocusedWallet(wid);
}; };
$scope.toggleWalletSelection = function() {
$scope.walletSelection = !$scope.walletSelection;
};
}); });

View file

@ -1,10 +1,8 @@
<div ng-controller="SidebarController"> <div ng-controller="SidebarController">
<header> <header>
<!-- <div ng&#45;show="$root.wallet.isShared()" ng&#45;include="'views/includes/peer&#45;list.html'"></div> --> <!-- <div ng&#45;show="$root.wallet.isShared()" ng&#45;include="'views/includes/peer&#45;list.html'"></div> -->
<div data-ng-repeat="item in $root.iden.listWallets() track by $index" class="nav-item db p20h">
<a ng-click="switchWallet(item.id)" ng-if="item.id != $root.wallet.id "> <i class="size-21 m20r fi-bitcoin-circle"></i> {{item.name || item.id}}</a>
<div ng-if="item.id == $root.wallet.id ">
<div> <div>
<a ng-click="toggleWalletSelection()"><i class="fi-plus"></i></a>
<a href="#!/receive" class="name-wallet" tooltip-placement="bottom" tooltip="ID: {{$root.wallet.id}}"> {{$root.wallet.getName()}} </a> <a href="#!/receive" class="name-wallet" tooltip-placement="bottom" tooltip="ID: {{$root.wallet.id}}"> {{$root.wallet.getName()}} </a>
<a class="button gray small side-bar right" title="{{'Manual Update'|translate}}" ng-disabled="$root.loading" ng-click="refresh()"><i class="size-16 fi-refresh"></i></a> <a class="button gray small side-bar right" title="{{'Manual Update'|translate}}" ng-disabled="$root.loading" ng-click="refresh()"><i class="size-16 fi-refresh"></i></a>
</div> </div>
@ -19,7 +17,6 @@
</span> &nbsp; </span> &nbsp;
<i class="fi-info medium" tooltip="{{'Balance locked in pending transaction proposals'|translate}}" tooltip-placement="bottom"></i> <i class="fi-info medium" tooltip="{{'Balance locked in pending transaction proposals'|translate}}" tooltip-placement="bottom"></i>
</div> </div>
</div>
<!-- <div class="wfooter"> <!-- <div class="wfooter">
<span ng-if="$root.wallet.isShared()"> <span ng-if="$root.wallet.isShared()">
{{$root.wallet.requiredCopayers}} <span translate>of</span> {{$root.wallet.totalCopayers}} wallet {{$root.wallet.requiredCopayers}} <span translate>of</span> {{$root.wallet.totalCopayers}} wallet
@ -29,10 +26,16 @@
</span> </span>
</div> --> </div> -->
</div> </div>
</div>
</header> </header>
<ul class="side-nav" ng-if="$root.wallet.isReady()">
<ul class="side-nav" ng-if="walletSelection">
<li data-ng-repeat="item in $root.iden.listWallets() track by $index" class="nav-item">
<a ng-click="switchWallet(item.id)" ng-if="item.id != $root.wallet.id ">{{item.name || item.id}}</a>
</li>
</ul>
<ul class="side-nav" ng-if="!walletSelection && $root.wallet.isReady()">
<li data-ng-repeat="item in menu" ui-route="{{item.link}}" class="nav-item" data-ng-class="{active: isActive(item)}"> <li data-ng-repeat="item in menu" ui-route="{{item.link}}" class="nav-item" data-ng-class="{active: isActive(item)}">
<a href="#!/{{item.link}}" ng-click="toggleCollapse()" class="db p20h"> <a href="#!/{{item.link}}" ng-click="toggleCollapse()" class="db p20h">
<i class="size-21 m20r {{item.icon}}"></i> {{item.title|translate}} <i class="size-21 m20r {{item.icon}}"></i> {{item.title|translate}}