From 3d5522b227d9c665283922694d7d7e16b8d7d055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 13 Oct 2016 11:27:34 -0300 Subject: [PATCH] adding has click --- src/js/controllers/confirm.js | 1 + src/js/controllers/modals/txpDetails.js | 1 + src/js/services/platformInfo.js | 16 ++++++++++++++++ www/views/confirm.html | 6 +++--- www/views/modals/txp-details.html | 6 +++--- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index e58419fb3..465257e7c 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -32,6 +32,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( throw ('bad params'); } $scope.isCordova = platformInfo.isCordova; + $scope.hasClick = platformInfo.hasClick; $scope.data = {}; var config = configService.getSync().wallet; diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index 081826b1c..853383dd1 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -17,6 +17,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi $scope.canSign = $scope.wallet.canSign() || $scope.wallet.isPrivKeyExternal(); $scope.color = $scope.wallet.color; $scope.data = {}; + $scope.hasClick = platformInfo.hasClick; $scope.displayAmount = getDisplayAmount(tx.amountStr); $scope.displayUnit = getDisplayUnit(tx.amountStr); initActionList(); diff --git a/src/js/services/platformInfo.js b/src/js/services/platformInfo.js index f634e8f0f..6a8def4be 100644 --- a/src/js/services/platformInfo.js +++ b/src/js/services/platformInfo.js @@ -39,5 +39,21 @@ angular.module('copayApp.services').factory('platformInfo', function($window) { ret.isChromeApp = $window.chrome && chrome.runtime && chrome.runtime.id && !ret.isNW; ret.isDevel = !ret.isMobile && !ret.isChromeApp && !ret.isNW; + ret.hasClick = false; + + if ($window.sessionStorage.getItem('hasClick')) { + ret.hasClick = true; + } + + $window.addEventListener('mousedown', function() { + ret.hasClick = true; + $window.sessionStorage.setItem('hasClick', 'true'); + }); + + $window.addEventListener('touchstart', function() { + ret.hasClick = false; + $window.sessionStorage.removeItem('hasClick'); + }); + return ret; }); diff --git a/www/views/confirm.html b/www/views/confirm.html index 30f060e46..953dc89fb 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -7,7 +7,7 @@ - +
@@ -59,13 +59,13 @@
Click to pay Slide to pay diff --git a/www/views/modals/txp-details.html b/www/views/modals/txp-details.html index f0011f515..6f8573994 100644 --- a/www/views/modals/txp-details.html +++ b/www/views/modals/txp-details.html @@ -11,7 +11,7 @@ - +
@@ -152,7 +152,7 @@ Click to accept @@ -168,7 +168,7 @@ Slide to accept