mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix(client): set state chagne to scroll to top
closes #7880 fixes #4326
This commit is contained in:
@@ -23,9 +23,10 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||||||
|
|
||||||
$rootScope.$on('$stateChangeSuccess',
|
$rootScope.$on('$stateChangeSuccess',
|
||||||
function(event, toState, toParams, fromState, fromParams){
|
function(event, toState, toParams, fromState, fromParams){
|
||||||
|
|
||||||
$rootScope.pageTitle = $state.current.title;
|
$rootScope.pageTitle = $state.current.title;
|
||||||
|
|
||||||
|
$window.scrollTo(0, 0);
|
||||||
|
|
||||||
if (!!fromState.name) Analytics.track({'hitType':'pageview','eventCategory':'navigation','eventAction':'navigate','page':'/#/'+toState.name});
|
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) {
|
if (toState.name=='options.social.inbox' && User.user.inbox && User.user.inbox.newMessages > 0) {
|
||||||
User.clearNewMessages();
|
User.clearNewMessages();
|
||||||
|
|||||||
Reference in New Issue
Block a user