reverted to binding to live model objects

This commit is contained in:
Ivan Socolsky 2015-01-04 12:30:31 -03:00
commit 361b16d222
3 changed files with 7 additions and 16 deletions

View file

@ -1,18 +1,9 @@
'use strict';
var watching;
angular.module('copayApp.controllers').controller('HomeWalletController', function($scope, $rootScope, $timeout, $filter, $modal, rateService, notification, txStatus, identityService) {
$scope.initHome = function() {
$rootScope.title = 'Home';
if (!watching) {
watching = $rootScope.$watch('wallet', function (w) {
$scope.isShared = w.isShared();
$scope.requiresMultipleSignatures = w.requiresMultipleSignatures();
if ($scope.isShared)
$scope.copayers = w.getRegisteredPeerIds();
});
}
};
$scope.openTxModal = function(tx) {

View file

@ -37,8 +37,8 @@
<div class="row ">
<div class="large-12 columns line-t m10t">
<div class="right size-12">
<span ng-if="!isShared">Personal Wallet</span>
<span ng-if="isShared">
<span ng-if="!$root.wallet.isShared()">Personal Wallet</span>
<span ng-if="$root.wallet.isShared()">
Multisignature wallet [{{$root.wallet.requiredCopayers}} of {{$root.wallet.totalCopayers}} ]
</span>
<span ng-if="$root.wallet.isTestnet()"> in TESTNET</span>
@ -50,7 +50,7 @@
</div>
<div ng-show="requiresMultipleSignatures">
<div ng-show="$root.wallet.requiresMultipleSignatures()">
<div class="row">
<div class="large-12 columns">
<div class="panel oh">
@ -73,7 +73,7 @@
</div>
</div>
<div class="row" ng-if="isShared">
<div class="row" ng-if="$root.wallet.isShared()">
<!-- List of copayers -->
<div class="large-12 columns">
<div class="panel oh">

View file

@ -1,5 +1,5 @@
<div>
<div class="copay-box" ng-repeat="copayer in copayers">
<div class="copay-box" ng-repeat="copayer in $root.wallet.getRegisteredPeerIds()">
<div class="photo-container">
<img gravatar-src="'{{copayer.nick}}'" gravatar-size="35">
</div>