From 7b3b108026c8092f75e8b963fbd54b8132bcce08 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 11 Jan 2016 17:07:39 -0300 Subject: [PATCH] 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); });