change confirmation and alert modal for confirmation ionic popup
This commit is contained in:
parent
b2bf99b5bf
commit
8c16460d29
8 changed files with 108 additions and 168 deletions
|
|
@ -32,6 +32,10 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
.popup-body {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.bct {
|
||||
background-color: transparent !important;
|
||||
margin-top: -25px;
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('confirmTxController', function(configService, feeService, rateService) {
|
||||
|
||||
|
||||
this.processFee = function(amount, fee) {
|
||||
var walletSettings = configService.getSync().wallet.settings;
|
||||
var feeAlternativeIsoCode = walletSettings.alternativeIsoCode;
|
||||
|
||||
this.feeLevel = feeService.feeOpts[feeService.getCurrentFeeLevel()];
|
||||
this.feeAlternativeStr = parseFloat((rateService.toFiat(fee, feeAlternativeIsoCode)).toFixed(2), 10) + ' ' + feeAlternativeIsoCode;
|
||||
this.feeRateStr = (fee / (amount + fee) * 100).toFixed(2) + '%' ;
|
||||
};
|
||||
|
||||
this.close = function(cb) {
|
||||
return cb();
|
||||
};
|
||||
|
||||
this.accept = function(cb) {
|
||||
return cb(true);
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, $ionicScrollDelegate, $ionicPopup, latestReleaseService, bwcService, pushNotificationsService, lodash, go, profileService, configService, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, addonManager, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, platformInfo, addressbookService, walletService) {
|
||||
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, $ionicScrollDelegate, $ionicPopup, latestReleaseService, feeService, bwcService, pushNotificationsService, lodash, go, profileService, configService, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, addonManager, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, platformInfo, addressbookService, walletService) {
|
||||
var self = this;
|
||||
var SOFT_CONFIRMATION_LIMIT = 12;
|
||||
var errors = bwcService.getErrors();
|
||||
|
|
@ -1111,15 +1111,23 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
|
||||
self.showErrorPopup = function(msg, cb) {
|
||||
$log.warn('Showing err popup:' + msg);
|
||||
self.showAlert = {
|
||||
msg: msg,
|
||||
close: function() {
|
||||
self.showAlert = null;
|
||||
if (cb) return cb();
|
||||
},
|
||||
};
|
||||
$timeout(function() {
|
||||
$rootScope.$apply();
|
||||
|
||||
function openErrorPopup(msg, cb) {
|
||||
$scope.msg = msg;
|
||||
|
||||
self.errorPopup = $ionicPopup.show({
|
||||
templateUrl: 'views/includes/alert.html',
|
||||
scope: $scope,
|
||||
});
|
||||
|
||||
$scope.close = function() {
|
||||
return cb();
|
||||
};
|
||||
}
|
||||
|
||||
openErrorPopup(msg, function() {
|
||||
self.errorPopup.close();
|
||||
if (cb) return cb();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1864,15 +1872,37 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
|
||||
$rootScope.$on('Local/NeedsConfirmation', function(event, txp, cb) {
|
||||
self.confirmTx = {
|
||||
txp: txFormatService.processTx(txp),
|
||||
callback: function(accept) {
|
||||
self.confirmTx = null;
|
||||
return cb(accept);
|
||||
}
|
||||
};
|
||||
$timeout(function() {
|
||||
$rootScope.$apply();
|
||||
|
||||
function openConfirmationPopup(txp, cb) {
|
||||
|
||||
$scope.tx = txFormatService.processTx(txp);
|
||||
|
||||
self.confirmationPopup = $ionicPopup.show({
|
||||
templateUrl: 'views/includes/confirm-tx.html',
|
||||
scope: $scope,
|
||||
});
|
||||
|
||||
$scope.processFee = function(amount, fee) {
|
||||
var walletSettings = configService.getSync().wallet.settings;
|
||||
var feeAlternativeIsoCode = walletSettings.alternativeIsoCode;
|
||||
|
||||
$scope.feeLevel = feeService.feeOpts[feeService.getCurrentFeeLevel()];
|
||||
$scope.feeAlternativeStr = parseFloat((rateService.toFiat(fee, feeAlternativeIsoCode)).toFixed(2), 10) + ' ' + feeAlternativeIsoCode;
|
||||
$scope.feeRateStr = (fee / (amount + fee) * 100).toFixed(2) + '%';
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
return cb();
|
||||
};
|
||||
|
||||
$scope.accept = function() {
|
||||
return cb(true);
|
||||
};
|
||||
}
|
||||
|
||||
openConfirmationPopup(txp, function(accept) {
|
||||
self.confirmationPopup.close();
|
||||
return cb(accept);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ h4.title a {
|
|||
}
|
||||
}
|
||||
|
||||
.modal-content h4, .glidera h4, .coinbase h4, .txModal h4 {
|
||||
.modal-content h4, .glidera h4, .coinbase h4 {
|
||||
background: #F6F7F9;
|
||||
padding: 25px 0px 5px 10px;
|
||||
text-transform: uppercase;
|
||||
|
|
@ -105,7 +105,7 @@ h4.title a {
|
|||
font-size: 16px;
|
||||
}
|
||||
|
||||
.preferences ul, .modal-content ul, .txModal ul {
|
||||
.preferences ul, .modal-content ul {
|
||||
font-size: 14px;
|
||||
background: white;
|
||||
}
|
||||
|
|
@ -255,6 +255,12 @@ a {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
.half-row {
|
||||
width: 50%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
|
|
@ -1339,61 +1345,6 @@ input.ng-invalid-match {
|
|||
}
|
||||
}
|
||||
|
||||
/* Confirmation popup */
|
||||
|
||||
.confirmTxModal {
|
||||
background: white;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
width: 90%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 15% auto;
|
||||
z-index: 1100;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.confirmHead {
|
||||
padding: 10px;
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
|
||||
.txModal-content {
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
.txModal {
|
||||
background: #f6f7f9;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
z-index: 1100;
|
||||
}
|
||||
|
||||
.alertModal, .passModal {
|
||||
background: #FFFFFF;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
width: 90%;
|
||||
left: 5%;
|
||||
top: 15%;
|
||||
z-index: 1100;
|
||||
}
|
||||
|
||||
.modalMask {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1099;
|
||||
opacity: 0.8;
|
||||
background: black;
|
||||
}
|
||||
|
||||
.tx-details-blockchain li {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
|
@ -2006,13 +1957,6 @@ body.modal-open {
|
|||
}
|
||||
}
|
||||
|
||||
.txModal.animated {
|
||||
&.slideInRight, &.slideOutRight {
|
||||
-webkit-animation-duration: 0.3s;
|
||||
animation-duration: 0.3s;
|
||||
}
|
||||
}
|
||||
|
||||
.reveal-modal.animated {
|
||||
&.fadeOutUp, &.slideInUp, &.slideInDown {
|
||||
-webkit-animation-duration: 0.3s;
|
||||
|
|
@ -2068,7 +2012,7 @@ body.modal-open {
|
|||
padding: 5px 15px;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
i {
|
||||
position: absolute;
|
||||
position: inherit;
|
||||
left: 25px;
|
||||
padding-right: 10px;
|
||||
border-right: 1px solid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue