diff --git a/website/client/css/header.styl b/website/client/css/header.styl index e85a43aae6..8bd722e365 100644 --- a/website/client/css/header.styl +++ b/website/client/css/header.styl @@ -18,7 +18,7 @@ padding: 0 // remove padding when toolbar is hidden .sticky-wrapper - height: 215px !important + height: 215px /* login/menu buttons --------------------- */ diff --git a/website/client/js/controllers/rootCtrl.js b/website/client/js/controllers/rootCtrl.js index ad3827b6f0..71ce8306b4 100644 --- a/website/client/js/controllers/rootCtrl.js +++ b/website/client/js/controllers/rootCtrl.js @@ -8,9 +8,12 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$ var user = User.user; var initSticky = _.once(function(){ - if (window.env.IS_MOBILE || User.user.preferences.stickyHeader === false) return; - $('.header-wrap').sticky({topSpacing:0}); - }) + $timeout(function () { + if (window.env.IS_MOBILE || User.user.preferences.stickyHeader === false) return; + $('.header-wrap').sticky({topSpacing:0}); + }); + }); + $rootScope.$on('userUpdated',initSticky); $rootScope.$on('$stateChangeSuccess', diff --git a/website/client/js/services/userServices.js b/website/client/js/services/userServices.js index c6ea3e7286..615b130ddb 100644 --- a/website/client/js/services/userServices.js +++ b/website/client/js/services/userServices.js @@ -80,8 +80,6 @@ angular.module('habitrpg') _.extend(user, response.data.data); - $rootScope.$emit('userUpdated', user); - if (!user._wrapped) { // This wraps user with `ops`, which are functions shared both on client and mobile. When performed on client, // they update the user in the browser and then send the request to the server, where the same operation is @@ -106,6 +104,7 @@ angular.module('habitrpg') syncUserTasks(tasks); $rootScope.$emit('userSynced'); $rootScope.appLoaded = true; + $rootScope.$emit('userUpdated', user); }); }