Merge pull request #3845 from tanojaja/fix/scroll-up

scroll up
This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-08 13:33:05 -05:00
commit e62e372a1a
4 changed files with 16 additions and 9 deletions

View file

@ -49,13 +49,13 @@
</div> </div>
<form name="setupForm" ng-submit="create.create(setupForm)" novalidate> <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"> <span class="text-warning">
{{create.error|translate}} {{create.error|translate}}
</span> </span>
</div> </div>
<div class="row"> <div class="row">
<div class="large-12 columns"> <div class="large-12 columns">
<div ng-hide="create.hideWalletName"> <div ng-hide="create.hideWalletName">
<label><span translate>Wallet name</span> <label><span translate>Wallet name</span>
@ -169,7 +169,7 @@
<span>Testnet</span> <span>Testnet</span>
<switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch> <switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch>
</label> </label>
</div> </div>
</div> <!-- columns --> </div> <!-- columns -->
</div> <!-- advanced --> </div> <!-- advanced -->

View file

@ -517,4 +517,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-hide="$root.shouldHideMenuBar" ng-include="'views/includes/menu.html'" ng-show="!index.noFocusedWallet"></div>

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('createController', 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 self = this;
var defaults = configService.getDefaults(); var defaults = configService.getDefaults();
@ -164,6 +164,7 @@ angular.module('copayApp.controllers').controller('createController',
if (err) { if (err) {
$log.warn(err); $log.warn(err);
self.error = err; self.error = err;
scrollUp('notification');
$timeout(function() { $timeout(function() {
$rootScope.$apply(); $rootScope.$apply();
}); });
@ -174,6 +175,12 @@ angular.module('copayApp.controllers').controller('createController',
}, 100); }, 100);
} }
function scrollUp(location){
if(!location) return;
$location.hash(location);
$anchorScroll();
};
this.formFocus = function(what) { this.formFocus = function(what) {
if (!this.isWindowsPhoneApp) return if (!this.isWindowsPhoneApp) return

View file

@ -4,7 +4,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
var self = this; var self = this;
window.ignoreMobilePause = false; window.ignoreMobilePause = false;
$rootScope.hideMenuBar = false; $rootScope.shouldHideMenuBar = false;
$rootScope.wpInputFocused = false; $rootScope.wpInputFocused = false;
var config = configService.getSync(); var config = configService.getSync();
var configWallet = config.wallet; var configWallet = config.wallet;
@ -84,7 +84,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
disableFocusListener(); disableFocusListener();
disableResumeListener(); disableResumeListener();
disableOngoingProcessListener(); disableOngoingProcessListener();
$rootScope.hideMenuBar = false; $rootScope.shouldHideMenuBar = false;
}); });
this.onQrCodeScanned = function(data) { this.onQrCodeScanned = function(data) {
@ -638,10 +638,10 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.hideMenuBar = lodash.debounce(function(hide) { this.hideMenuBar = lodash.debounce(function(hide) {
if (hide) { if (hide) {
$rootScope.hideMenuBar = true; $rootScope.shouldHideMenuBar = true;
this.bindTouchDown(); this.bindTouchDown();
} else { } else {
$rootScope.hideMenuBar = false; $rootScope.shouldHideMenuBar = false;
} }
$rootScope.$digest(); $rootScope.$digest();
}, 100); }, 100);