fixes recommended by Matias

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

View file

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

View file

@ -56,7 +56,7 @@
<ul> <ul>
<li data-ng-repeat="item in menu" ui-route="/{{item.link}}" class="text-center" data-ng-class="{active: isActive(item)}"> <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}} <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> </a>
</li> </li>
</ul> </ul>

View file

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