From 32d563e367ea9dcdaec89ba0081d646748054a83 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 9 Jun 2016 15:03:14 -0300 Subject: [PATCH] Revert "Click scrolls to focused inputs" --- public/views/walletHome.html | 35 +++++++++++++++--------------- src/js/controllers/walletHome.js | 37 ++++++++++++++++---------------- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 65800fd56..46490b007 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -352,7 +352,7 @@ send --> - +

@@ -380,27 +380,27 @@

-
+
- - + + Not valid - +
- -
-
+
diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index 63a773c1f..88bb49eca 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $interval, $ionicScrollDelegate, $timeout, $filter, $modal, $log, $ionicModal, notification, txStatus, profileService, lodash, configService, rateService, storageService, bitcore, gettext, gettextCatalog, platformInfo, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, walletService, fingerprintService, nodeWebkit) { +angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $interval, $timeout, $filter, $modal, $log, $ionicModal, notification, txStatus, profileService, lodash, configService, rateService, storageService, bitcore, gettext, gettextCatalog, platformInfo, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, walletService, fingerprintService, nodeWebkit) { var isCordova = platformInfo.isCordova; var isWP = platformInfo.isWP; @@ -36,7 +36,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi self.setForm(data); $rootScope.$emit('Local/SetTab', 'send'); - var form = self.sendForm; + var form = $scope.sendForm; if (form.address.$invalid && !self.blockUx) { self.resetForm(); self.error = gettext('Could not recognize a valid Bitcoin QR Code'); @@ -279,17 +279,20 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi }); } - this.formFocus = function(what) { - - if (what == 'msg') { - $timeout(function() { - $ionicScrollDelegate.scrollBottom(true); - }, 300); + this.hideMenuBar = lodash.debounce(function(hide) { + if (hide) { + $rootScope.shouldHideMenuBar = true; + this.bindTouchDown(); + } else { + $rootScope.shouldHideMenuBar = false; } - if (what == 'address') { - $timeout(function() { - $ionicScrollDelegate.scrollTop(true); - }, 300); + $rootScope.$digest(); + }, 100); + + + this.formFocus = function(what) { + if (isCordova && !this.isWindowsPhoneApp) { + this.hideMenuBar(what); } var self = this; @@ -319,11 +322,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi this.hideAmount = true; } } - $timeout(function() { $rootScope.$digest(); }, 1); - }; this.setSendFormInputs = function() { @@ -376,7 +377,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi }, set: function(newValue) { $scope.__address = self.onAddressChange(newValue); - if (self.sendForm && self.sendForm.address.$valid) { + if ($scope.sendForm && $scope.sendForm.address.$valid) { self.lockAddress = true; } }, @@ -436,7 +437,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi this.hideAmount = false; } - var form = self.sendForm; + var form = $scope.sendForm; var comment = form.comment.$modelValue; // ToDo: use a credential's (or fc's) function for this @@ -574,7 +575,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi }; this.setForm = function(to, amount, comment) { - var form = self.sendForm; + var form = $scope.sendForm; if (to) { form.address.$setViewValue(to); form.address.$isValid = true; @@ -607,7 +608,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi this._amount = this._address = null; - var form = self.sendForm; + var form = $scope.sendForm; if (form && form.amount) { form.amount.$pristine = true;