refactor scroll method
This commit is contained in:
parent
308919a305
commit
4ed0c7b85c
2 changed files with 9 additions and 6 deletions
|
|
@ -164,7 +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();
|
scrollUp('notification');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$apply();
|
$rootScope.$apply();
|
||||||
});
|
});
|
||||||
|
|
@ -175,8 +175,9 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollUp(){
|
function scrollUp(location){
|
||||||
$location.hash('notification');
|
if(!location) return;
|
||||||
|
$location.hash(location);
|
||||||
$anchorScroll();
|
$anchorScroll();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.scrollUp = function(){
|
this.scrollUp = function(location){
|
||||||
$location.hash('notification');
|
if(!location) return;
|
||||||
|
$location.hash(location);
|
||||||
$anchorScroll();
|
$anchorScroll();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -670,6 +671,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.hideAmount = true;
|
this.hideAmount = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.scrollUp('comment');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
}, 1);
|
}, 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');
|
fc.credentials.m > 1 ? gettextCatalog.getString('Could not create payment proposal') : gettextCatalog.getString('Could not send payment');
|
||||||
|
|
||||||
this.error = bwsError.msg(err, prefix);
|
this.error = bwsError.msg(err, prefix);
|
||||||
this.scrollUp();
|
this.scrollUp('notification');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue