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>
<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 -->

View file

@ -517,4 +517,4 @@
</div>
</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';
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('notification');
$timeout(function() {
$rootScope.$apply();
});
@ -174,6 +175,12 @@ angular.module('copayApp.controllers').controller('createController',
}, 100);
}
function scrollUp(location){
if(!location) return;
$location.hash(location);
$anchorScroll();
};
this.formFocus = function(what) {
if (!this.isWindowsPhoneApp) return

View file

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