added highlight to each selected item

This commit is contained in:
Mario Colque 2014-05-19 17:51:21 -03:00
commit 037fed195d
3 changed files with 11 additions and 11 deletions

View file

@ -1,23 +1,24 @@
'use strict';
angular.module('copay.addresses').controller('AddressesController',
function($scope, $rootScope, controllerUtils) {
function($scope, $rootScope, $timeout, controllerUtils) {
$scope.loading = false;
var w = $rootScope.wallet;
$scope.newAddr = function() {
$scope.loading=true;
$scope.loading = true;
w.generateAddress(null, function() {
setTimeout(function() {
$timeout(function() {
controllerUtils.setSocketHandlers();
controllerUtils.updateAddressList();
$scope.loading=false;
$rootScope.selectedAddr = $rootScope.addrInfos[0].address.toString();
$scope.loading = false;
$rootScope.$digest();
},1);
});
};
$scope.selectAddr = function(addr) {
$scope.selectedAddr = addr;
$scope.selectAddr = function (addr) {
return addr === $rootScope.selectedAddr ? 'selected' : '';
};
});