Merge branch 'develop' into paglias/realtime-chat-v1

This commit is contained in:
Matteo Pagliazzi
2016-09-09 20:13:21 +02:00
63 changed files with 483 additions and 125 deletions

View File

@@ -6,6 +6,10 @@
habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$http', '$state', '$stateParams', 'Notification', 'Groups', 'Shared', 'Content', '$modal', '$timeout', 'ApiUrl', 'Payments','$sce','$window','Analytics','TAVERN_ID', 'Pusher',
function($scope, $rootScope, $location, User, $http, $state, $stateParams, Notification, Groups, Shared, Content, $modal, $timeout, ApiUrl, Payments, $sce, $window, Analytics, TAVERN_ID, Pusher) {
var user = User.user;
var IGNORE_SCROLL_PAGES = {
'options.social.challenges.detail': true,
'options.social.challenges': true
};
// Setup page once user is synced
var clearAppLoadedListener = $rootScope.$watch('appLoaded', function (after) {
@@ -24,8 +28,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 (!($state.current.name in IGNORE_SCROLL_PAGES)) {
$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) {