mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
fix(client): set state chagne to scroll to top
closes #7880 fixes #4326
This commit is contained in:
parent
858da4f9c9
commit
fed1eb8c21
1 changed files with 2 additions and 1 deletions
|
|
@ -23,9 +23,10 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||
|
||||
$rootScope.$on('$stateChangeSuccess',
|
||||
function(event, toState, toParams, fromState, fromParams){
|
||||
|
||||
$rootScope.pageTitle = $state.current.title;
|
||||
|
||||
$window.scrollTo(0, 0);
|
||||
|
||||
if (!!fromState.name) Analytics.track({'hitType':'pageview','eventCategory':'navigation','eventAction':'navigate','page':'/#/'+toState.name});
|
||||
if (toState.name=='options.social.inbox' && User.user.inbox && User.user.inbox.newMessages > 0) {
|
||||
User.clearNewMessages();
|
||||
|
|
|
|||
Loading…
Reference in a new issue