diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 9258e521d..c85a6a55d 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -190,6 +190,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( }; var setSendError = function(msg) { + $scope.sendStatus = ''; popupService.showAlert(gettextCatalog.getString('Error at confirm:'), msg); }; @@ -197,7 +198,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.fee = txFormatService.formatAmountStr(txp.fee); $scope.txp = txp; $scope.$apply(); - }; + } var createTx = function(wallet, dryRun, cb) { var config = configService.getSync().wallet; @@ -327,6 +328,8 @@ angular.module('copayApp.controllers').controller('confirmController', function( } } + $scope.statusChangeHandler = statusChangeHandler; + $scope.onConfirm = function() { $scope.approve(statusChangeHandler); }; @@ -335,6 +338,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( $ionicHistory.nextViewOptions({ disableAnimate: true }); + $scope.sendStatus = ''; $state.go('tabs.send'); }; diff --git a/src/js/directives/clickToAccept.js b/src/js/directives/clickToAccept.js new file mode 100644 index 000000000..36cfbaeb5 --- /dev/null +++ b/src/js/directives/clickToAccept.js @@ -0,0 +1,20 @@ +'use strict'; + +angular.module('copayApp.directives') + .directive('clickToAccept', function() { + return { + restrict: 'E', + templateUrl: 'views/includes/clickToAccept.html', + transclude: true, + scope: { + sendStatus: '=clickSendStatus', + }, + link: function(scope, element, attrs) { + scope.$watch('sendStatus', function() { + if(scope.sendStatus !== 'success') { + scope.displaySendStatus = scope.sendStatus; + } + }); + } + }; + }); diff --git a/src/sass/views/includes/clickToAccept.scss b/src/sass/views/includes/clickToAccept.scss new file mode 100644 index 000000000..7a60de930 --- /dev/null +++ b/src/sass/views/includes/clickToAccept.scss @@ -0,0 +1,40 @@ +click-to-accept { + + .click-to-accept { + &__status-text { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 4; + text-transform: capitalize; + transform: translateY(2rem); + opacity: 0; + + &.enter { + transition: transform 250ms ease, opacity 250ms ease; + transform: translateY(0); + opacity: 1; + } + + > img { + margin-right: 10px; + animation-name: spin; + animation-duration: 500ms; + animation-iteration-count: infinite; + animation-timing-function: linear; + } + } + + } + + @keyframes spin { + from { + transform:rotate(0deg); + } + to { + transform:rotate(360deg); + } + } +} diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index d7d4cb891..565408372 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -19,6 +19,7 @@ @import "includes/walletActivity"; @import "includes/wallets"; @import "includes/modals/modals"; +@import "includes/clickToAccept"; @import "includes/slideToAccept"; @import "includes/slideToAcceptSuccess"; @import "includes/tx-details"; diff --git a/www/views/confirm.html b/www/views/confirm.html index 127b011f0..ac0527ba6 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -59,7 +59,13 @@ - + + + Click to pay + + + + + + + {{displaySendStatus}} + +