remove slide to delete and adding that option to addr entry view

This commit is contained in:
Gabriel Bazán 2017-05-24 16:40:07 -03:00
parent acbfb87f45
commit 828b174c23
4 changed files with 16 additions and 17 deletions

View File

@ -46,19 +46,6 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
$scope.addressbook = result;
};
$scope.remove = function(addr) {
$timeout(function() {
addressbookService.remove(addr, function(err, ab) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
initAddressbook();
$scope.$digest();
});
}, 100);
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.isChromeApp = platformInfo.isChromeApp;
$scope.showAddIcon = false;

View File

@ -19,4 +19,14 @@ angular.module('copayApp.controllers').controller('addressbookViewController', f
}, 100);
};
$scope.remove = function(addr) {
addressbookService.remove(addr, function(err, ab) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
$ionicHistory.goBack();
});
};
});

View File

@ -42,9 +42,6 @@
<h2>{{addrEntry.name}}</h2>
<p>{{addrEntry.address}}</p>
<i class="icon bp-arrow-right"></i>
<ion-option-button class="button-assertive" ng-click="remove(addrEntry.address)">
<i class="icon ion-minus-circled"></i>
</ion-option-button>
</ion-item>
</ion-list>
</ion-content>

View File

@ -5,6 +5,11 @@
<ion-nav-title>
<span>{{addressbookEntry.name}}</span>
</ion-nav-title>
<ion-nav-buttons side="secondary">
<button class="button back-button" ng-click="remove(addressbookEntry.address)">
Remove
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content scroll="false">
<div class="gravatar-content">
@ -23,7 +28,7 @@
<span>{{addressbookEntry.email}}</span>
</div>
<div class="item item-text-wrap">
<span class="address-book-field-label" translate>Address</span>
<span class="address-book-field-label" copy-to-clipboard="addressbookEntry.address" translate>Address</span>
<span>{{addressbookEntry.address}}</span>
</div>
</div>