scroll up when error occurs

This commit is contained in:
Javier 2016-01-29 15:21:42 -03:00
commit 308919a305
4 changed files with 20 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();
$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