Initial implementation for balance modal.
This commit is contained in:
parent
43836a4743
commit
4d3ff6c2f0
9 changed files with 273 additions and 34 deletions
24
src/js/controllers/modals/walletBalance.js
Normal file
24
src/js/controllers/modals/walletBalance.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('walletBalanceController', function($scope, $timeout, $ionicHistory, gettextCatalog, configService, feeService, ongoingProcess, popupService) {
|
||||
|
||||
ongoingProcess.set('gettingFeeLevels', true);
|
||||
feeService.getFeeLevels(function(err, levels) {
|
||||
ongoingProcess.set('gettingFeeLevels', false);
|
||||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
return;
|
||||
}
|
||||
$scope.feeLevels = levels;
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
$scope.close = function() {
|
||||
$scope.walletBalanceModal.hide();
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
$scope.feeOpts = feeService.feeOpts;
|
||||
$scope.currentFeeLevel = feeService.getCurrentFeeLevel();
|
||||
});
|
||||
});
|
||||
|
|
@ -107,6 +107,15 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
});
|
||||
};
|
||||
|
||||
$scope.openBalanceModal = function() {
|
||||
$ionicModal.fromTemplateUrl('views/modals/wallet-balance.html', {
|
||||
scope: $scope
|
||||
}).then(function(modal) {
|
||||
$scope.walletBalanceModal = modal;
|
||||
$scope.walletBalanceModal.show();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.recreate = function() {
|
||||
walletService.recreate($scope.wallet, function(err) {
|
||||
if (err) return;
|
||||
|
|
@ -252,16 +261,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
return;
|
||||
}
|
||||
prevPos = pos;
|
||||
var amountHeight = 180 - pos;
|
||||
var amountHeight = 210 - pos;
|
||||
if (amountHeight < 80) {
|
||||
amountHeight = 80;
|
||||
}
|
||||
var contentMargin = amountHeight;
|
||||
if (contentMargin > 180) {
|
||||
contentMargin = 180;
|
||||
if (contentMargin > 210) {
|
||||
contentMargin = 210;
|
||||
}
|
||||
|
||||
var amountScale = (amountHeight / 180);
|
||||
var amountScale = (amountHeight / 210);
|
||||
if (amountScale < 0.5) {
|
||||
amountScale = 0.5;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue