fix sticky header not working

This commit is contained in:
Matteo Pagliazzi
2016-06-07 21:12:31 +02:00
parent e1b8d52a27
commit 5e01b3d129
3 changed files with 8 additions and 6 deletions

View File

@@ -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',