-
-
-
+
diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js
index 88bb49eca..63a773c1f 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, $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, $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) {
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 = $scope.sendForm;
+ var form = self.sendForm;
if (form.address.$invalid && !self.blockUx) {
self.resetForm();
self.error = gettext('Could not recognize a valid Bitcoin QR Code');
@@ -279,20 +279,17 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
});
}
- this.hideMenuBar = lodash.debounce(function(hide) {
- if (hide) {
- $rootScope.shouldHideMenuBar = true;
- this.bindTouchDown();
- } else {
- $rootScope.shouldHideMenuBar = false;
- }
- $rootScope.$digest();
- }, 100);
-
-
this.formFocus = function(what) {
- if (isCordova && !this.isWindowsPhoneApp) {
- this.hideMenuBar(what);
+
+ if (what == 'msg') {
+ $timeout(function() {
+ $ionicScrollDelegate.scrollBottom(true);
+ }, 300);
+ }
+ if (what == 'address') {
+ $timeout(function() {
+ $ionicScrollDelegate.scrollTop(true);
+ }, 300);
}
var self = this;
@@ -322,9 +319,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.hideAmount = true;
}
}
+
$timeout(function() {
$rootScope.$digest();
}, 1);
+
};
this.setSendFormInputs = function() {
@@ -377,7 +376,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
},
set: function(newValue) {
$scope.__address = self.onAddressChange(newValue);
- if ($scope.sendForm && $scope.sendForm.address.$valid) {
+ if (self.sendForm && self.sendForm.address.$valid) {
self.lockAddress = true;
}
},
@@ -437,7 +436,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.hideAmount = false;
}
- var form = $scope.sendForm;
+ var form = self.sendForm;
var comment = form.comment.$modelValue;
// ToDo: use a credential's (or fc's) function for this
@@ -575,7 +574,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
};
this.setForm = function(to, amount, comment) {
- var form = $scope.sendForm;
+ var form = self.sendForm;
if (to) {
form.address.$setViewValue(to);
form.address.$isValid = true;
@@ -608,7 +607,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this._amount = this._address = null;
- var form = $scope.sendForm;
+ var form = self.sendForm;
if (form && form.amount) {
form.amount.$pristine = true;