fix(client): set state chagne to scroll to top

closes #7880
fixes #4326
This commit is contained in:
Blade Barringer
2016-08-11 07:59:12 -05:00
parent 858da4f9c9
commit fed1eb8c21

View File

@@ -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();