refactor scroll method

This commit is contained in:
Javier 2016-01-29 15:56:36 -03:00
commit 4ed0c7b85c
2 changed files with 9 additions and 6 deletions

View file

@ -164,7 +164,7 @@ angular.module('copayApp.controllers').controller('createController',
if (err) {
$log.warn(err);
self.error = err;
scrollUp();
scrollUp('notification');
$timeout(function() {
$rootScope.$apply();
});
@ -175,8 +175,9 @@ angular.module('copayApp.controllers').controller('createController',
}, 100);
}
function scrollUp(){
$location.hash('notification');
function scrollUp(location){
if(!location) return;
$location.hash(location);
$anchorScroll();
};

View file

@ -97,8 +97,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$rootScope.$digest();
});
this.scrollUp = function(){
$location.hash('notification');
this.scrollUp = function(location){
if(!location) return;
$location.hash(location);
$anchorScroll();
};
@ -670,6 +671,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.hideAmount = true;
}
}
this.scrollUp('comment');
$timeout(function() {
$rootScope.$digest();
}, 1);
@ -744,7 +746,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();
this.scrollUp('notification');
$timeout(function() {
$scope.$digest();
}, 1);