mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix sticky header not working
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
padding: 0 // remove padding when toolbar is hidden
|
||||
|
||||
.sticky-wrapper
|
||||
height: 215px !important
|
||||
height: 215px
|
||||
|
||||
/* login/menu buttons
|
||||
--------------------- */
|
||||
|
||||
@@ -8,9 +8,12 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
var user = User.user;
|
||||
|
||||
var initSticky = _.once(function(){
|
||||
$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',
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user