From c4ce8b8b8d0536d35ea48151c5f4717204b950db Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 11 Jan 2016 16:46:50 -0300 Subject: [PATCH 1/3] Fix Glidera resume event in the 2FA step --- src/js/controllers/buyGlidera.js | 2 ++ src/js/controllers/glidera.js | 2 ++ src/js/controllers/sellGlidera.js | 2 ++ src/js/controllers/walletHome.js | 1 + src/js/init.js | 4 +++- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/buyGlidera.js b/src/js/controllers/buyGlidera.js index 155e4a883..b6777f326 100644 --- a/src/js/controllers/buyGlidera.js +++ b/src/js/controllers/buyGlidera.js @@ -9,6 +9,8 @@ angular.module('copayApp.controllers').controller('buyGlideraController', this.success = null; this.loading = null; + window.ignoreMobilePause = true; + var otherWallets = function(testnet) { var network = testnet ? 'testnet' : 'livenet'; return lodash.filter(profileService.getWallets(network), function(w) { diff --git a/src/js/controllers/glidera.js b/src/js/controllers/glidera.js index 87024f2e4..94659b3f9 100644 --- a/src/js/controllers/glidera.js +++ b/src/js/controllers/glidera.js @@ -3,6 +3,8 @@ angular.module('copayApp.controllers').controller('glideraController', function($scope, $timeout, $modal, profileService, configService, storageService, glideraService, isChromeApp, animationService) { + window.ignoreMobilePause = true; + this.getAuthenticateUrl = function() { return glideraService.getOauthCodeUrl(); }; diff --git a/src/js/controllers/sellGlidera.js b/src/js/controllers/sellGlidera.js index 616892aa7..cbae3f8f3 100644 --- a/src/js/controllers/sellGlidera.js +++ b/src/js/controllers/sellGlidera.js @@ -14,6 +14,8 @@ angular.module('copayApp.controllers').controller('sellGlideraController', this.currentFeeLevel = config.wallet.settings.feeLevel || 'normal'; var fc; + window.ignoreMobilePause = true; + var otherWallets = function(testnet) { var network = testnet ? 'testnet' : 'livenet'; return lodash.filter(profileService.getWallets(network), function(w) { diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index c27076b7a..e1edca494 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -3,6 +3,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService) { var self = this; + window.ignoreMobilePause = false; $rootScope.hideMenuBar = false; $rootScope.wpInputFocused = false; var config = configService.getSync(); diff --git a/src/js/init.js b/src/js/init.js index 9c6b29c7b..9da59595b 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -45,7 +45,9 @@ angular.element(document).ready(function() { }, 100); } setTimeout(function() { - window.ignoreMobilePause = false; + var loc = window.location; + var ignoreMobilePause = loc.toString().match(/(glidera|buy|sell)/) ? 'true' : 'false'; + window.ignoreMobilePause = ignoreMobilePause; }, 100); }, false); From 7b3b108026c8092f75e8b963fbd54b8132bcce08 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 11 Jan 2016 17:07:39 -0300 Subject: [PATCH 2/3] Glidera: Fix padding and close modal with the back button or swipe-right --- public/views/glidera.html | 2 +- public/views/modals/glidera-tx-details.html | 2 +- src/js/controllers/glidera.js | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/public/views/glidera.html b/public/views/glidera.html index 589078f3d..ecbb23ec5 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -6,7 +6,7 @@ -
+
diff --git a/public/views/modals/glidera-tx-details.html b/public/views/modals/glidera-tx-details.html index fb379ec58..56b1abe97 100644 --- a/public/views/modals/glidera-tx-details.html +++ b/public/views/modals/glidera-tx-details.html @@ -30,7 +30,7 @@
-
    +
    • Status diff --git a/src/js/controllers/glidera.js b/src/js/controllers/glidera.js index 94659b3f9..df876cf9a 100644 --- a/src/js/controllers/glidera.js +++ b/src/js/controllers/glidera.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('glideraController', - function($scope, $timeout, $modal, profileService, configService, storageService, glideraService, isChromeApp, animationService) { + function($rootScope, $scope, $timeout, $modal, profileService, configService, storageService, glideraService, isChromeApp, animationService, lodash) { window.ignoreMobilePause = true; @@ -37,6 +37,7 @@ angular.module('copayApp.controllers').controller('glideraController', }; this.openTxModal = function(token, tx) { + $rootScope.modalOpened = true; var self = this; var config = configService.getSync().wallet.settings; var fc = profileService.focusedClient; @@ -50,9 +51,9 @@ angular.module('copayApp.controllers').controller('glideraController', $scope.tx = tx; }); - $scope.cancel = function() { + $scope.cancel = lodash.debounce(function() { $modalInstance.dismiss('cancel'); - }; + }, 0, 1000); }; @@ -62,7 +63,13 @@ angular.module('copayApp.controllers').controller('glideraController', controller: ModalInstanceCtrl, }); + var disableCloseModal = $rootScope.$on('closeModal', function() { + modalInstance.dismiss('cancel'); + }); + modalInstance.result.finally(function() { + $rootScope.modalOpened = false; + disableCloseModal(); var m = angular.element(document.getElementsByClassName('reveal-modal')); m.addClass(animationService.modalAnimated.slideOutRight); }); From 4f999d8f7daa86775aadeb2917e6e814715d56bf Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 12 Jan 2016 11:32:11 -0300 Subject: [PATCH 3/3] Remove quotes --- src/js/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/init.js b/src/js/init.js index 9da59595b..3bcc05d45 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -46,7 +46,7 @@ angular.element(document).ready(function() { } setTimeout(function() { var loc = window.location; - var ignoreMobilePause = loc.toString().match(/(glidera|buy|sell)/) ? 'true' : 'false'; + var ignoreMobilePause = loc.toString().match(/(glidera|buy|sell)/) ? true : false; window.ignoreMobilePause = ignoreMobilePause; }, 100); }, false);