payment intents style fixes

This commit is contained in:
Matias Alejo Garcia 2014-12-10 20:30:36 -03:00
commit af6ee93ae5
6 changed files with 96 additions and 118 deletions

View file

@ -20,56 +20,6 @@
transition: height 250ms ease-in; transition: height 250ms ease-in;
} }
.w-popup-menu li {
-webkit-transition: all 300ms linear;
-moz-transition: all 300ms linear;
-o-transition: all 300ms linear;
-ms-transition: all 300ms linear;
transition: all 300ms linear;
}
.w-popup-icon {
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
-o-transition: all 200ms linear;
-ms-transition: all 200ms linear;
transition: all 200ms linear;
}
.w-popup-main {
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
-o-transition: all 200ms linear;
-ms-transition: all 200ms linear;
transition: all 200ms linear;
}
.w-popup-sub {
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
-o-transition: all 200ms linear;
-ms-transition: all 200ms linear;
transition: all 200ms linear;
}
.w-popup-menu li:hover .w-popup-icon {
-webkit-animation: moveFromTop 400ms ease;
-moz-animation: moveFromTop 400ms ease;
-ms-animation: moveFromTop 400ms ease;
}
.w-popup-menu li:hover .w-popup-main {
-webkit-animation: moveFromTop 300ms ease;
-moz-animation: moveFromTop 300ms ease;
-ms-animation: moveFromTop 300ms ease;
}
.w-popup-menu li:hover .w-popup-sub {
-webkit-animation: moveFromBottom 500ms ease;
-moz-animation: moveFromBottom 500ms ease;
-ms-animation: moveFromBottom 500ms ease;
}
.icon-rotate { .icon-rotate {
animation-name: rotateThis; animation-name: rotateThis;
animation-duration: 2s; animation-duration: 2s;

View file

@ -268,7 +268,9 @@ input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill, inpu
color: #FFF; color: #FFF;
} }
.side-nav.wallets .avatar-wallet{ .side-nav.wallets .avatar-wallet,
.wallet-selection.wallets .avatar-wallet
{
background-color: #7A8C9E; background-color: #7A8C9E;
color: #213140; color: #213140;
padding: 0.35rem 0.5rem; padding: 0.35rem 0.5rem;
@ -1168,6 +1170,28 @@ button.gray:focus,
text-transform: uppercase; text-transform: uppercase;
} }
.wallet-selection.wallets {
background-color: #213140 ;
}
ul.wallet-selection.wallets {
margin: 0;
overflow: hidden;
}
.wallet-selection.wallets li {
overflow: hidden;
padding: 1rem;
}
.wallet-selection.wallets li a {
display: block;
}
.wallet-selection.wallets li:hover {
background-color: #3C4E60;
}
.side-nav.wallets li { .side-nav.wallets li {
margin: 1.2rem 0; margin: 1.2rem 0;
padding: 0.3rem 0.1rem; padding: 0.3rem 0.1rem;
@ -1188,12 +1212,15 @@ button.gray:focus,
height: 100%; height: 100%;
} }
.wallet-selection.wallets a.wallet-item,
.wallet-selection.wallets a.wallet-item:hover,
.side-nav.wallets a.wallet-item, .side-nav.wallets a.wallet-item,
.side-nav.wallets a.wallet-item:hover { .side-nav.wallets a.wallet-item:hover {
color: #7A8C9E; color: #7A8C9E;
line-height: 20px; line-height: 20px;
} }
.wallet-selection.wallets .type-wallet,
.side-nav.wallets .type-wallet { .side-nav.wallets .type-wallet {
color: #AAB1B9; color: #AAB1B9;
} }

View file

@ -2,50 +2,47 @@ var bitcore = require('bitcore');
angular.module('copayApp.controllers').controller('walletForPaymentController', function($rootScope, $scope, $modal, identityService, go) { angular.module('copayApp.controllers').controller('walletForPaymentController', function($rootScope, $scope, $modal, identityService, go) {
$scope.selectWallet = function(cb) { // INIT: (not it a function, since there is no associated html)
var ModalInstanceCtrl = function($scope, $modalInstance, identityService) {
$scope.loading = true;
preconditions.checkState($rootScope.iden);
var iden = $rootScope.iden; var ModalInstanceCtrl = function($scope, $modalInstance, identityService) {
iden.on('newWallet', function() { $scope.loading = true;
$scope.setWallets(); preconditions.checkState($rootScope.iden);
});
$scope.setWallets = function() { var iden = $rootScope.iden;
$scope.wallets = $rootScope.iden.listWallets(); iden.on('newWallet', function() {
}; $scope.setWallets();
});
$scope.ok = function(w) { $scope.setWallets = function() {
$modalInstance.close(); $scope.wallets = $rootScope.iden.listWallets();
return cb(w);
};
$scope.cancel = function() {
$modalInstance.close();
return cb();
};
}; };
$modal.open({ $scope.ok = function(w) {
templateUrl: 'views/modals/walletSelection.html', $modalInstance.close(w);
windowClass: 'tiny', };
controller: ModalInstanceCtrl,
}); $scope.cancel = function() {
$rootScope.pendingPayment = null;
$modalInstance.close();
};
}; };
var modalInstance = $modal.open({
templateUrl: 'views/modals/walletSelection.html',
windowClass: 'tiny',
controller: ModalInstanceCtrl,
});
// INIT: (not it a function, since there is no associated html) modalInstance.result.then(function(w) {
if (!$rootScope.pendingPayment) { if (w) {
identityService.setFocusedWallet(w);
$rootScope.walletForPaymentSet = true;
} else {
$rootScope.pendingPayment = null;
}
go.walletHome(); go.walletHome();
} else { }, function() {
$scope.selectWallet(function(w) { $rootScope.pendingPayment = null;
if (w) { go.walletHome();
identityService.setFocusedWallet(w); });
go.send();
} else {
go.walletHome();
}
});
};
}); });

View file

@ -65,7 +65,11 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
root.path('copayers'); root.path('copayers');
} else { } else {
if ($rootScope.pendingPayment) { if ($rootScope.pendingPayment) {
root.path('selectWalletForPayment'); if ($rootScope.walletForPaymentSet) {
root.path('send');
} else {
root.path('selectWalletForPayment');
}
} else { } else {
root.path('homeWallet'); root.path('homeWallet');
} }

View file

@ -6,12 +6,12 @@
<li <li
ng-repeat="item in wallets track by $index" ng-repeat="item in wallets track by $index"
ng-class="{'selected': item.id == $root.wallet.id}" ng-class="{'selected': item.id == $root.wallet.id}"
class="nav-item"> class="nav-item" ng-click="switchWallet(item.id)" >
<div class="col1"> <div class="col1">
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div> <div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
</div> </div>
<div class="col2"> <div class="col2">
<a ng-click="switchWallet(item.id)" class="size-12 wallet-item"> <a class="size-12 wallet-item">
<div class="oh"> <div class="oh">
<div class="right size-10 type-wallet"> <div class="right size-10 type-wallet">
[ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div> [ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>

View file

@ -1,29 +1,29 @@
<a class="close-reveal-modal" ng-click="cancel()">&#215;</a> <div ng-init="setWallets()">
<h3 ng-init="setWallets()">Select a wallet to make the payment</h3> <a class="close-reveal-modal" ng-click="cancel()">&#215;</a>
<span ng-show="!wallets[0]">Loading...</span>
<ul class="w-popup-menu" ng-show="wallets[0]" ng-class="{'large':wallets.length > 4, 'medium':wallets.length > 2 && wallets.length < 5}"> <h1 class="line-b"> Select a wallet to make the payment</h1>
<li data-ng-repeat="item in wallets track by $index" class="nav-item" ng-click="ok(item)" ng-show="+item.balanceInfo.totalBalanceBTC > 0">
<div class="w-popup-icon"> <div class="m20v" ng-show="!wallets[0]">Loading...</div>
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div> <ul class="wallet-selection wallets" ng-show="wallets[0]">
</div> <li ng-repeat="item in wallets track by $index" class="nav-item" ng-show="+item.balanceInfo.totalBalanceBTC > 0" ng-click="ok(item)">
<div class="w-popup-content"> <div class="col1">
<div class=""> <div class="avatar-wallet">{{item.getName() | limitTo: 1}}</div>
</div>
<div class="col2">
<a class="size-12 wallet-item"> <a class="size-12 wallet-item">
<div class=""> <div class="oh">
<div class="w-popup-main">[ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div> <div class="right size-10 type-wallet">
<div class="w-popup-sub size-18">{{item.name || item.id}}</div> [ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>
<div class="ellipsis name-wallet">{{item.getName()}}</div>
</div> </div>
<div class="w-popup-sub"> <div class="oh">
<span ng-if="item.balanceInfo.updatingBalance"><i class="fi-bitcoin-circle icon-rotate spinner"></i></span> <b class="m5r size-12">{{item.balanceInfo.totalBalance || 0}} {{item.settings.unitName}}</b>
<div ng-if="!item.balanceInfo.updatingBalance" data-options="disable_for_touch:true"> <span class="alt-currency size-10">{{item.balanceInfo.totalBalanceAlternative}} {{item.balanceInfo.alternativeIsoCode}}</span>
<b class="m5r size-12">{{item.balanceInfo.totalBalance || 0}} {{item.settings.unitName}}</b>
<span class="alt-currency size-10">{{item.balanceInfo.totalBalanceAlternative}} {{item.balanceInfo.alternativeIsoCode}}</span>
</div>
</div> </div>
</a> </a>
</div> </div>
</div> </li>
</li> </ul>
</ul>
</div>