mirror of https://github.com/BTCPrivate/copay.git
scroll up when error occurs
This commit is contained in:
parent
0875b7dd5b
commit
308919a305
|
@ -49,13 +49,13 @@
|
|||
</div>
|
||||
|
||||
<form name="setupForm" ng-submit="create.create(setupForm)" novalidate>
|
||||
<div class="box-notification m20b" ng-show="create.error">
|
||||
<div class="box-notification m20b" id="notification" ng-show="create.error">
|
||||
<span class="text-warning">
|
||||
{{create.error|translate}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns">
|
||||
|
||||
<div ng-hide="create.hideWalletName">
|
||||
<label><span translate>Wallet name</span>
|
||||
|
@ -169,7 +169,7 @@
|
|||
<span>Testnet</span>
|
||||
<switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- columns -->
|
||||
</div> <!-- advanced -->
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@
|
|||
<qr-scanner on-scan="home.onQrCodeScanned(data)"></qr-scanner>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-notification m20t" ng-show="home.error" ng-click="home.resetError()">
|
||||
<div class="box-notification m20t" id="notification" ng-show="home.error" ng-click="home.resetError()">
|
||||
<span class="text-warning">
|
||||
{{home.error|translate}}
|
||||
</span>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('createController',
|
||||
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isCordova, gettext, ledger, trezor, isMobile, isChromeApp, isDevel, derivationPathHelper) {
|
||||
function($scope, $location, $anchorScroll, $rootScope, $timeout, $log, lodash, go, profileService, configService, isCordova, gettext, ledger, trezor, isMobile, isChromeApp, isDevel, derivationPathHelper) {
|
||||
|
||||
var self = this;
|
||||
var defaults = configService.getDefaults();
|
||||
|
@ -164,6 +164,7 @@ angular.module('copayApp.controllers').controller('createController',
|
|||
if (err) {
|
||||
$log.warn(err);
|
||||
self.error = err;
|
||||
scrollUp();
|
||||
$timeout(function() {
|
||||
$rootScope.$apply();
|
||||
});
|
||||
|
@ -174,6 +175,11 @@ angular.module('copayApp.controllers').controller('createController',
|
|||
}, 100);
|
||||
}
|
||||
|
||||
function scrollUp(){
|
||||
$location.hash('notification');
|
||||
$anchorScroll();
|
||||
};
|
||||
|
||||
this.formFocus = function(what) {
|
||||
if (!this.isWindowsPhoneApp) return
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, isMobile, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, txSignService) {
|
||||
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $location, $anchorScroll, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, isMobile, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, txSignService) {
|
||||
|
||||
var self = this;
|
||||
window.ignoreMobilePause = false;
|
||||
|
@ -97,6 +97,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
$rootScope.$digest();
|
||||
});
|
||||
|
||||
this.scrollUp = function(){
|
||||
$location.hash('notification');
|
||||
$anchorScroll();
|
||||
};
|
||||
|
||||
var accept_msg = gettextCatalog.getString('Accept');
|
||||
var cancel_msg = gettextCatalog.getString('Cancel');
|
||||
var confirm_msg = gettextCatalog.getString('Confirm');
|
||||
|
@ -596,7 +601,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
});
|
||||
};
|
||||
|
||||
// Send
|
||||
// Send
|
||||
|
||||
this.canShowAlternative = function() {
|
||||
return $scope.showAlternative;
|
||||
|
@ -739,7 +744,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
fc.credentials.m > 1 ? gettextCatalog.getString('Could not create payment proposal') : gettextCatalog.getString('Could not send payment');
|
||||
|
||||
this.error = bwsError.msg(err, prefix);
|
||||
|
||||
this.scrollUp();
|
||||
$timeout(function() {
|
||||
$scope.$digest();
|
||||
}, 1);
|
||||
|
@ -1076,7 +1081,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
}
|
||||
};
|
||||
|
||||
// History
|
||||
// History
|
||||
|
||||
function strip(number) {
|
||||
return (parseFloat(number.toPrecision(12)));
|
||||
|
|
Loading…
Reference in New Issue