mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
fix sticky header not working
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
padding: 0 // remove padding when toolbar is hidden
|
padding: 0 // remove padding when toolbar is hidden
|
||||||
|
|
||||||
.sticky-wrapper
|
.sticky-wrapper
|
||||||
height: 215px !important
|
height: 215px
|
||||||
|
|
||||||
/* login/menu buttons
|
/* login/menu buttons
|
||||||
--------------------- */
|
--------------------- */
|
||||||
|
|||||||
@@ -8,9 +8,12 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||||||
var user = User.user;
|
var user = User.user;
|
||||||
|
|
||||||
var initSticky = _.once(function(){
|
var initSticky = _.once(function(){
|
||||||
if (window.env.IS_MOBILE || User.user.preferences.stickyHeader === false) return;
|
$timeout(function () {
|
||||||
$('.header-wrap').sticky({topSpacing:0});
|
if (window.env.IS_MOBILE || User.user.preferences.stickyHeader === false) return;
|
||||||
})
|
$('.header-wrap').sticky({topSpacing:0});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$rootScope.$on('userUpdated',initSticky);
|
$rootScope.$on('userUpdated',initSticky);
|
||||||
|
|
||||||
$rootScope.$on('$stateChangeSuccess',
|
$rootScope.$on('$stateChangeSuccess',
|
||||||
|
|||||||
@@ -80,8 +80,6 @@ angular.module('habitrpg')
|
|||||||
|
|
||||||
_.extend(user, response.data.data);
|
_.extend(user, response.data.data);
|
||||||
|
|
||||||
$rootScope.$emit('userUpdated', user);
|
|
||||||
|
|
||||||
if (!user._wrapped) {
|
if (!user._wrapped) {
|
||||||
// This wraps user with `ops`, which are functions shared both on client and mobile. When performed on client,
|
// 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
|
// 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);
|
syncUserTasks(tasks);
|
||||||
$rootScope.$emit('userSynced');
|
$rootScope.$emit('userSynced');
|
||||||
$rootScope.appLoaded = true;
|
$rootScope.appLoaded = true;
|
||||||
|
$rootScope.$emit('userUpdated', user);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user