Revert "Click scrolls to focused inputs"
This commit is contained in:
parent
07064a8679
commit
32d563e367
2 changed files with 37 additions and 35 deletions
|
|
@ -352,7 +352,7 @@
|
||||||
send
|
send
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<ion-content id="send" class="send tab-view" overflow-scroll="true">
|
<div id="send" class="send tab-view">
|
||||||
<div class="pr p25b">
|
<div class="pr p25b">
|
||||||
<h4 class="title m0">
|
<h4 class="title m0">
|
||||||
<available-balance ng-show="!index.shouldHideBalance"></available-balance>
|
<available-balance ng-show="!index.shouldHideBalance"></available-balance>
|
||||||
|
|
@ -380,27 +380,27 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row m20t">
|
<div class="row m20t">
|
||||||
<div class="large-12 large-centered columns">
|
<div class="large-12 large-centered columns">
|
||||||
<form name="home.sendForm" ng-disabled="home.blockUx || home.onGoingProcess" novalidate>
|
<form name="sendForm" ng-disabled="home.blockUx || home.onGoingProcess" novalidate>
|
||||||
|
|
||||||
<div ng-hide="home._paypro || home.hideAddress">
|
<div ng-hide="home._paypro || home.hideAddress">
|
||||||
<div class="row collapse">
|
<div class="row collapse">
|
||||||
<label for="address" class="left" >
|
<label for="address" class="left" >
|
||||||
<span translate>To</span>
|
<span translate>To</span>
|
||||||
</label>
|
</label>
|
||||||
<span ng-hide="home.sendForm.address.$pristine">
|
<span ng-hide="sendForm.address.$pristine">
|
||||||
<span class="has-error right size-12" ng-show="home.sendForm.address.$invalid && _address">
|
<span class="has-error right size-12" ng-show="sendForm.address.$invalid && _address">
|
||||||
<i class="icon-close-circle size-14"></i>
|
<i class="icon-close-circle size-14"></i>
|
||||||
<span class="vm" translate>Not valid</span>
|
<span class="vm" translate>Not valid</span>
|
||||||
</span>
|
</span>
|
||||||
<small class="right text-primary" ng-show="!home.sendForm.address.$invalid">
|
<small class="right text-primary" ng-show="!sendForm.address.$invalid">
|
||||||
<i class="icon-checkmark-circle size-14"></i>
|
<i class="icon-checkmark-circle size-14"></i>
|
||||||
</small>
|
</small>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input ng-show="home.sendForm.address.$invalid" class="m0" type="text" id="address" name="address" ng-disabled="home.blockUx || home.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-focus="home.formFocus('address')" ng-blur="home.formFocus(false)">
|
<input ng-show="sendForm.address.$invalid" class="m0" type="text" id="address" name="address" ng-disabled="home.blockUx || home.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-focus="home.formFocus('address')" ng-blur="home.formFocus(false)">
|
||||||
<div class="addressbook-input" ng-show="!home.sendForm.address.$invalid && _address">
|
<div class="addressbook-input" ng-show="!sendForm.address.$invalid && _address">
|
||||||
{{index.addressbook[_address] || _address}}
|
{{index.addressbook[_address] || _address}}
|
||||||
</div>
|
</div>
|
||||||
<a class="postfix size-12 m0 text-gray"
|
<a class="postfix size-12 m0 text-gray"
|
||||||
|
|
@ -427,12 +427,12 @@
|
||||||
|
|
||||||
<div class="row" ng-init="home.hideAlternative()" ng-hide="home.hideAmount">
|
<div class="row" ng-init="home.hideAlternative()" ng-hide="home.hideAmount">
|
||||||
<div class="large-12 medium-12 columns">
|
<div class="large-12 medium-12 columns">
|
||||||
<div class="right" ng-hide="home.sendForm.amount.$pristine && !home.sendForm.amount.$modelValue ">
|
<div class="right" ng-hide="sendForm.amount.$pristine && !sendForm.amount.$modelValue ">
|
||||||
<span class="has-error right size-12" ng-if="home.sendForm.amount.$invalid">
|
<span class="has-error right size-12" ng-if="sendForm.amount.$invalid">
|
||||||
<i class="icon-close-circle size-14"></i>
|
<i class="icon-close-circle size-14"></i>
|
||||||
<span clas="vm" translate>Not valid</span>
|
<span clas="vm" translate>Not valid</span>
|
||||||
</span>
|
</span>
|
||||||
<small class="text-primary right" ng-if="!home.sendForm.amount.$invalid && !home.sendForm.alternative.$invalid">
|
<small class="text-primary right" ng-if="!sendForm.amount.$invalid && !sendForm.alternative.$invalid">
|
||||||
<i class="icon-checkmark-circle size-14"></i>
|
<i class="icon-checkmark-circle size-14"></i>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -460,22 +460,23 @@
|
||||||
<div class="row" ng-hide="home.hideNote">
|
<div class="row" ng-hide="home.hideNote">
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<label for="comment"><span translate>Description</span>
|
<label for="comment"><span translate>Description</span>
|
||||||
<small translate ng-hide="!home.sendForm.comment.$pristine">optional</small>
|
<small translate ng-hide="!sendForm.comment.$pristine">optional</small>
|
||||||
<small translate class="has-error" ng-show="home.sendForm.comment.$invalid && !home.sendForm.comment.$pristine">too long!</small>
|
<small translate class="has-error" ng-show="sendForm.comment.$invalid && !sendForm.comment.$pristine">too long!</small>
|
||||||
</label>
|
</label>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<textarea id="comment" ng-disabled="home.blockUx" name="comment"
|
<textarea id="comment" ng-disabled="home.blockUx" name="comment"
|
||||||
ng-maxlength="500" ng-model="_comment" ng-focus="home.formFocus('msg')" ng-blur="home.formFocus(false)"></textarea>
|
ng-maxlength="500" ng-model="_comment" ng-focus="home.formFocus('msg')"
|
||||||
|
ng-blur="home.formFocus(false)"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="!home.onGoingProcess">
|
<div class="row" ng-show="!home.onGoingProcess">
|
||||||
<div class="large-6 medium-6 small-6 columns" ng-show="!home.blockUx && (home._paypro || home.lockAddress || home.lockAmount)">
|
<div class="large-6 medium-6 small-6 columns" ng-show="!home.blockUx && (home._paypro || home.lockAddress || home.lockAmount)">
|
||||||
<a ng-click="home.resetForm(home.sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
<a ng-click="home.resetForm(sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="columns" ng-class="{'small-6 medium-6 large-6':(home._paypro || home.lockAddress || home.lockAmount)}">
|
<div class="columns" ng-class="{'small-6 medium-6 large-6':(home._paypro || home.lockAddress || home.lockAmount)}">
|
||||||
<button class="button black round expand" ng-disabled="home.sendForm.$invalid || home.blockUx || index.isOffline || home.paymentExpired"
|
<button class="button black round expand" ng-disabled="sendForm.$invalid || home.blockUx || index.isOffline || home.paymentExpired"
|
||||||
ng-style="{'background-color':index.backgroundColor}" ng-click="home.submitForm()" translate>
|
ng-style="{'background-color':index.backgroundColor}" ng-click="home.submitForm()" translate>
|
||||||
Send
|
Send
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -486,7 +487,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="extra-margin-bottom"></div>
|
<div class="extra-margin-bottom"></div>
|
||||||
</ion-content> <!-- END Send -->
|
</div> <!-- END Send -->
|
||||||
|
|
||||||
<div id="{{view.id}}" class="{{view.class}} tab-view" ng-repeat="view in index.addonViews" ng-include="view.template">
|
<div id="{{view.id}}" class="{{view.class}} tab-view" ng-repeat="view in index.addonViews" ng-include="view.template">
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -494,4 +495,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="extra-margin-bottom"></div>
|
<div class="extra-margin-bottom"></div>
|
||||||
<div ng-include="'views/includes/menu.html'" ng-show="!index.noFocusedWallet"></div>
|
<div ng-include="'views/includes/menu.html'" ng-show="!index.noFocusedWallet && !$root.shouldHideMenuBar"></div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'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 isCordova = platformInfo.isCordova;
|
||||||
var isWP = platformInfo.isWP;
|
var isWP = platformInfo.isWP;
|
||||||
|
|
@ -36,7 +36,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
self.setForm(data);
|
self.setForm(data);
|
||||||
$rootScope.$emit('Local/SetTab', 'send');
|
$rootScope.$emit('Local/SetTab', 'send');
|
||||||
|
|
||||||
var form = self.sendForm;
|
var form = $scope.sendForm;
|
||||||
if (form.address.$invalid && !self.blockUx) {
|
if (form.address.$invalid && !self.blockUx) {
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
self.error = gettext('Could not recognize a valid Bitcoin QR Code');
|
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) {
|
this.hideMenuBar = lodash.debounce(function(hide) {
|
||||||
|
if (hide) {
|
||||||
if (what == 'msg') {
|
$rootScope.shouldHideMenuBar = true;
|
||||||
$timeout(function() {
|
this.bindTouchDown();
|
||||||
$ionicScrollDelegate.scrollBottom(true);
|
} else {
|
||||||
}, 300);
|
$rootScope.shouldHideMenuBar = false;
|
||||||
}
|
}
|
||||||
if (what == 'address') {
|
$rootScope.$digest();
|
||||||
$timeout(function() {
|
}, 100);
|
||||||
$ionicScrollDelegate.scrollTop(true);
|
|
||||||
}, 300);
|
|
||||||
|
this.formFocus = function(what) {
|
||||||
|
if (isCordova && !this.isWindowsPhoneApp) {
|
||||||
|
this.hideMenuBar(what);
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
@ -319,11 +322,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.hideAmount = true;
|
this.hideAmount = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setSendFormInputs = function() {
|
this.setSendFormInputs = function() {
|
||||||
|
|
@ -376,7 +377,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
},
|
},
|
||||||
set: function(newValue) {
|
set: function(newValue) {
|
||||||
$scope.__address = self.onAddressChange(newValue);
|
$scope.__address = self.onAddressChange(newValue);
|
||||||
if (self.sendForm && self.sendForm.address.$valid) {
|
if ($scope.sendForm && $scope.sendForm.address.$valid) {
|
||||||
self.lockAddress = true;
|
self.lockAddress = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -436,7 +437,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.hideAmount = false;
|
this.hideAmount = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var form = self.sendForm;
|
var form = $scope.sendForm;
|
||||||
var comment = form.comment.$modelValue;
|
var comment = form.comment.$modelValue;
|
||||||
|
|
||||||
// ToDo: use a credential's (or fc's) function for this
|
// 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) {
|
this.setForm = function(to, amount, comment) {
|
||||||
var form = self.sendForm;
|
var form = $scope.sendForm;
|
||||||
if (to) {
|
if (to) {
|
||||||
form.address.$setViewValue(to);
|
form.address.$setViewValue(to);
|
||||||
form.address.$isValid = true;
|
form.address.$isValid = true;
|
||||||
|
|
@ -607,7 +608,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
this._amount = this._address = null;
|
this._amount = this._address = null;
|
||||||
|
|
||||||
var form = self.sendForm;
|
var form = $scope.sendForm;
|
||||||
|
|
||||||
if (form && form.amount) {
|
if (form && form.amount) {
|
||||||
form.amount.$pristine = true;
|
form.amount.$pristine = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue