Merge pull request #5332 from gabrielbazan7/fix/customAmount

fix design issue on specific amount feature
This commit is contained in:
Javier Donadío 2016-12-23 11:24:06 -03:00 committed by GitHub
commit 0ec25a003d
7 changed files with 21 additions and 43 deletions

View File

@ -100,6 +100,13 @@ angular.module('copayApp.controllers').controller('addressesController', functio
});
};
$scope.requestSpecificAmount = function() {
$state.go('tabs.receive.amount', {
customAmount: true,
toAddress: $stateParams.toAddress
});
}
$scope.showInformation = function() {
$timeout(function() {
$scope.showInfo = !$scope.showInfo;

View File

@ -18,8 +18,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func
$scope.finish = function() {
$ionicHistory.nextViewOptions({
disableAnimate: false,
historyRoot: true
disableAnimate: false
});
$ionicHistory.goBack(-2);
};

View File

@ -3,7 +3,6 @@
angular.module('copayApp.controllers').controller('tabReceiveController', function($rootScope, $scope, $timeout, $log, $ionicModal, $state, $ionicHistory, $ionicPopover, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService, bwcError) {
var listeners = [];
var MENU_ITEM_HEIGHT = 55;
$scope.isCordova = platformInfo.isCordova;
$scope.isNW = platformInfo.isNW;
$scope.walletAddrs = {};
@ -50,8 +49,9 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
};
$scope.showAddresses = function() {
$state.transitionTo('tabs.receive.addresses', {
walletId: $scope.wallet.credentials.walletId
$state.go('tabs.receive.addresses', {
walletId: $scope.wallet.credentials.walletId,
toAddress: $scope.addr
});
};
@ -140,31 +140,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
});
};
var goRequestAmount = function() {
$scope.menu.hide();
$state.go('tabs.receive.amount', {
customAmount: true,
toAddress: $scope.addr
});
}
$scope.showMenu = function(allAddresses, $event) {
var requestAmountObj = {
text: gettextCatalog.getString('Request Specific amount'),
action: goRequestAmount,
};
$scope.items = [requestAmountObj];
$scope.height = $scope.items.length * MENU_ITEM_HEIGHT;
$ionicPopover.fromTemplateUrl('views/includes/menu-popover.html', {
scope: $scope
}).then(function(popover) {
$scope.menu = popover;
$scope.menu.show($event);
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallets = profileService.getWallets();

View File

@ -614,7 +614,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*/
.state('tabs.receive.addresses', {
url: '/addresses/:walletId',
url: '/addresses/:walletId/:toAddress',
views: {
'tab-receive@tabs': {
controller: 'addressesController',

View File

@ -47,7 +47,6 @@
font-size: .9rem;
}
&.view-all {
margin: 20px 0px 20px 0px;
cursor: pointer;
cursor: hand;
i {

View File

@ -26,11 +26,19 @@
<div class="addr-explanation" ng-if="showInfo">
<div class="addr-description">
<span translate>It's a good idea to avoid reusing addresses-this both protects your privacy and keeps your bitcoins secure against hypothetical attacks by quantum computers.</span>&nbsp<a ng-click="showInformation()" translate>Hide</a>
<span translate>It's a good idea to avoid reusing addresses - this both protects your privacy and keeps your bitcoins secure against hypothetical attacks by quantum computers.</span>&nbsp<a ng-click="showInformation()" translate>Hide</a>
</div>
</div>
<div class="list">
<div class="item item-icon-right view-all" ng-show="viewAll.value" ng-click="requestSpecificAmount()">
<span translate>Request Specific amount</span>
<i class="icon ion-ios-arrow-thin-right"></i>
</div>
<div class="item item-icon-right view-all" ng-show="viewAll.value" ng-click="viewAllAddresses()">
<span translate>View All Addresses</span>
<i class="icon ion-ios-arrow-thin-right"></i>
</div>
<div class="item item-divider item-icon-right" ng-click="newAddress()">
<span translate>Unused Addresses</span>
<i class="icon ion-ios-plus-empty"></i>
@ -61,11 +69,6 @@
<div class="addr-balance">{{w.balanceStr}}</div>
</div>
</div>
<div class="item item-icon-right view-all" ng-show="viewAll.value" ng-click="viewAllAddresses()">
<span translate>View All Addresses</span>
<i class="icon ion-ios-arrow-thin-right"></i>
</div>
</div>
</div>
</ion-content>

View File

@ -1,11 +1,6 @@
<ion-view id="tab-receive">
<ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Receive' | translate}}</ion-nav-title>
<ion-nav-buttons side="secondary">
<button ng-disabled="generatingAddress" class="button back-button" ng-click="showMenu(false, $event)">
<i class="icon ion-ios-more"></i>
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content scroll="false">
<article class="list card padding text-center" ng-if="!wallets[0]">