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

@ -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);