Merge pull request #6144 from cmgustavo/bug/addressbook-02
Bug/addressbook 02
This commit is contained in:
commit
77bd9c74b5
5 changed files with 32 additions and 22 deletions
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -114,6 +114,9 @@
|
|||
}
|
||||
|
||||
#address-book-view {
|
||||
.has-click {
|
||||
cursor: pointer;
|
||||
}
|
||||
.bar.bar-royal {
|
||||
border: 0 transparent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@
|
|||
</div>
|
||||
</ion-content>
|
||||
<ion-content ng-show="!isEmptyList">
|
||||
<div class="bar bar-header item-input-inset" ng-show="addressbook.length >= 5">
|
||||
<div class="bar bar-header item-input-inset">
|
||||
<label class="item-input-wrapper">
|
||||
<i class="icon ion-ios-search placeholder-icon"></i>
|
||||
<input type="search"
|
||||
placeholder="Search"
|
||||
ng-model="addrSearch"
|
||||
ng-change="findAddressbook(addrSearch)" ng-model-onblur>
|
||||
ng-model="addrSearch.value"
|
||||
ng-change="findAddressbook(addrSearch.value)" ng-model-onblur>
|
||||
</label>
|
||||
</div>
|
||||
<ion-list>
|
||||
|
|
|
|||
|
|
@ -5,11 +5,6 @@
|
|||
<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">
|
||||
|
|
@ -27,13 +22,19 @@
|
|||
<span class="address-book-field-label" translate>Email</span>
|
||||
<span>{{addressbookEntry.email}}</span>
|
||||
</div>
|
||||
<div class="item item-text-wrap">
|
||||
<span class="address-book-field-label" copy-to-clipboard="addressbookEntry.address" translate>Address</span>
|
||||
<div class="item item-text-wrap" copy-to-clipboard="addressbookEntry.address">
|
||||
<span class="address-book-field-label" translate>Address</span>
|
||||
<span>{{addressbookEntry.address}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="button button-standard button-primary" ng-click="sendTo()" translate>
|
||||
Send Money
|
||||
</button>
|
||||
<div class="item item-divider"></div>
|
||||
<div class="item item-icon-right has-click" ng-click="sendTo()">
|
||||
<span class="positive" translate>Send Money</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</div>
|
||||
<div class="item item-divider"></div>
|
||||
<div class="item has-click" ng-click="remove(addressbookEntry.address)">
|
||||
<span class="assertive" translate>Remove</span>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue