fixes recommended by Matias

This commit is contained in:
Gustavo Cortez 2014-05-13 11:27:31 -03:00
parent 8a03225cd2
commit 2c6ad1268e
3 changed files with 9 additions and 7 deletions

View File

@ -88,6 +88,11 @@ html, body {height: 100%;}
width: 25%;
}
.top-bar-section .label.alert {
vertical-align: super;
margin-left: 5px;
}
.header {
margin-bottom: 30px;
}

View File

@ -56,7 +56,7 @@
<ul>
<li data-ng-repeat="item in menu" ui-route="/{{item.link}}" class="text-center" data-ng-class="{active: isActive(item)}">
<a href="{{item.link}}"> <i class="{{item.icon}}"></i> {{item.title}}
<span class="label alert round" ng-if="item.title=='Transactions' && $root.txslength > 0">{{$root.txslength}}</span>
<span class="label alert round" ng-if="item.link=='#/transactions' && $root.pendingTxCount > 0">{{$root.pendingTxCount}}</span>
</a>
</li>
</ul>

View File

@ -83,7 +83,6 @@ angular.module('copay.controllerUtils')
$rootScope.$digest();
});
w.on('txProposalsUpdated', function() {
console.log('[ txProposalsUpdated ]'); //TODO
root.updateTxs();
root.updateBalance();
});
@ -109,7 +108,6 @@ angular.module('copay.controllerUtils')
if ($rootScope.addrInfos.length === 0) return;
$rootScope.loading = true;
w.getBalance(false, function(balance, balanceByAddr) {
console.log('New total balance:', balance);
$rootScope.totalBalance = balance;
$rootScope.balanceByAddr = balanceByAddr;
$rootScope.selectedAddr = $rootScope.addrInfos[0].address.toString();
@ -118,7 +116,6 @@ angular.module('copay.controllerUtils')
if (cb) cb();
});
w.getBalance(true, function(balance) {
console.log('New available balance:', balance);
$rootScope.availableBalance = balance;
$rootScope.loading = false;
$rootScope.$digest();
@ -154,13 +151,13 @@ angular.module('copay.controllerUtils')
txs.push(i);
});
$rootScope.txs = txs;
var txps = 0;
var pending = 0;
for(var i=0; i<txs.length;i++) {
if (!txs[i].finallyRejected && !txs[i].sentTs) {
txps++;
pending++;
}
}
$rootScope.txslength = txps;
$rootScope.pendingTxCount = pending;
w.removeListener('txProposalsUpdated',root.updateTxs)
w.once('txProposalsUpdated',root.updateTxs);
$rootScope.loading = false;