Merge pull request #6144 from cmgustavo/bug/addressbook-02

Bug/addressbook 02
This commit is contained in:
Gabriel Edgardo Bazán 2017-05-31 10:50:18 -03:00 committed by GitHub
commit 77bd9c74b5
5 changed files with 32 additions and 22 deletions

View file

@ -49,6 +49,7 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.isChromeApp = platformInfo.isChromeApp;
$scope.showAddIcon = false;
$scope.addrSearch = { value: null };
initAddressbook();
});

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService, $ionicHistory, platformInfo) {
angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService, $ionicHistory, platformInfo, gettextCatalog) {
$scope.isChromeApp = platformInfo.isChromeApp;
$scope.addressbookEntry = {};
$scope.addressbookEntry.name = $stateParams.name;
@ -20,13 +20,18 @@ angular.module('copayApp.controllers').controller('addressbookViewController', f
};
$scope.remove = function(addr) {
addressbookService.remove(addr, function(err, ab) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
$ionicHistory.goBack();
});
var title = gettextCatalog.getString('Warning!');
var message = gettextCatalog.getString('Are you sure you want to delete this contact?');
popupService.showConfirm(title, message, null, null, function(res) {
if (!res) return;
addressbookService.remove(addr, function(err, ab) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
$ionicHistory.goBack();
});
});
};
});

View file

@ -114,6 +114,9 @@
}
#address-book-view {
.has-click {
cursor: pointer;
}
.bar.bar-royal {
border: 0 transparent;
}